1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Best programming language for aspiring physics and engineers?

  1. Feb 16, 2014 #1
    I feel that I should start learning how to program. The only thing stopping me from reading a few books and watching some videos is the whole matter of which language to choose from. There are just so many of them. My question is what would be the best and most useful programming language to start learning first. I understand that learning many of them is desired/useful, but I have to start somewhere. So where should I start? I have read that the C languages are the most common, but I think that I read a while ago on this site that (a PF user said:) Python is what most scientists and engineers are using these days. I honestly don't have a clue about this subject. Any input would be met with lots of thanks.

    Thank you.
     
  2. jcsd
  3. Feb 16, 2014 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    This particular question has been explored at length before on PF. If you look at the Related Discussions box at the bottom of this page, you will see some related threads.
     
  4. Feb 16, 2014 #3
    Don't bother trying to learn programming on your own, it doesn't work. It suddenly you have to do work which requires some programming skill then it will become much easier to learn it then because it is necessary. If you just do random examples from some book you will forget everything the next day.
     
  5. Feb 16, 2014 #4
    I'm not going to doubt the difficulty level of learning how to program on my own. However, I think that if I want an edge in life, then it would probably be best to get started as soon as possible.
     
  6. Feb 16, 2014 #5
    Try looking into Project Euler. Once you decide what language to choose, you can use Project Euler to do useful things in it, instead of just "Playing around".

    Also, as far as languages go, once you learn one language and learn how to think like a programmer, more often than not learning another one is a lot easier. Like you mentioned, you might want to try C or C++.
     
  7. Feb 16, 2014 #6
    this has been asked more than a hundred times I am sure, given it has been asked at least 5 times in the last 3 months which given the age of PF it must be over 100. google search with site:physicsforums.com
     
  8. Feb 16, 2014 #7
    Oh my, you're right. There really does seem to be hundreds of these threads. Well thanks anyway for your help, my friends. And I will definitely look at Project Euler.
     
  9. Feb 16, 2014 #8

    jtbell

    User Avatar

    Staff: Mentor

    I've probably made these points in some of those bazillion other "which language" threads, but what the heck, I might as well make them again.

    1. Don't stress out over which language you start with. Just pick one and go with it for a while. For a general-purpose language, C++, C, Java or Python are decent choices that come to mind. There are probably some other candidates that I've forgotten about at the moment.

    I specifically exclude Fortran because it's more a "specialty" language nowadays, even though a lot of physicists and engineers use it. You can easily pick it up later as a second or third language if you need it.

    2. Whatever language you pick, learn its details and idioms well. Input, output, if-statements, loops, subroutines/functions, objects (if it's an object-oriented language), etc.

    3. When you get fairly comfortable with the details of your chosen language, start focusing on the overall issues of program design: how to put if-statements and loops together effectively, how to break up a large problem into smaller ones via subroutines or functions, how to lay out your data and pass it back and forth between subroutines and functions. Try different ways of doing the same thing, to get a feel for which ones feel more "elegant" or "understandable" to you.

    When you learn a second or third language (or more), you'll obviously have to repeat step 2, but it will probably be easier because many languages share the same general features, just expressing them with different "spelling" (syntax). However, a lot of the work you invest in step 3 will carry over from one language to another.
     
  10. Feb 19, 2014 #9
    I suggest starting with C or C++. After learning C, you will have no problem picking up new languages as you go. For science and engineering, you will find that a lot of people use Python or Matlab becauseyhey have a lot of built in features that can make life easy. I would pick up either one of those after you've been working with C for a while.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Best programming language for aspiring physics and engineers?
Loading...