Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What is Best Computer Programming Language to Learn?

  1. Dec 7, 2014 #1
    Is there a computer programming language that is the "best" and/or most transferable (in terms of making it easier to learn other languages down the line) for someone who is just getting started in this area?

    I literally have zero programming experience as of the moment, but would like to get started learning a language next semester. Is there any particular one that is highly recommended (or even one to avoid)?

    Thanks very much!
     
  2. jcsd
  3. Dec 7, 2014 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    It depends on what type of programming you intend to do, and on what kind of computer system. There are many passionate advocates of one language or another, but IMO, there is no one "best" language. In fact, many, in not most, programmers know or use more than one programming language.

    This question has been posed in one form or another on PF before. You can use the Search function of PF to find the older threads discussing this question.
     
  4. Dec 7, 2014 #3

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    I assume that you are interested in general purpose languages and not special purpose languages. A lot of main-stream languages (C++, Java, C#) have inherited from C. C is a good basic language, but does not introduce you to object oriented concepts. A reasonable course would be to start with C and start adding some C++ when you are comfortable with C. The reason I recommend C++ is that C syntax works in C++, but not so much in Java or C#. After a while, you will know if you want to switch over to Java or C#. A great deal of C and C++ knowledge transfers to those languages.
     
  5. Dec 7, 2014 #4

    phinds

    User Avatar
    Gold Member
    2016 Award

    SteamKing beat me to it, on both counts ... no "best" language and "do a forum search"
     
  6. Dec 7, 2014 #5

    jtbell

    User Avatar

    Staff: Mentor

    You don't even have to do a forum search. Just look at the "Similar Threads" list at the bottom of this page. There's one titled "What programing language should i learn?" Go to that thread, see if it has anything useful, then look at its "Similar Threads" list. Rinse and repeat.

    My 2 cents: Either C++ or Java. Both have been used a lot in introductory college/university computer science courses (in the US, anyway), so there are a lot of textbooks, and a lot of instructors' course materials available on the Web.

    For C++, this means you'll probably start with non-object-oriented programming using the C-like part of the language except probably for using iostreams instead of file pointers for input and output, and (hopefully) the standard C++ string data type instead of char* "strings" for text data. Then you'll learn about the fancy stuff like object-oriented programming, pointers, dynamic memory allocation, etc.
     
  7. Dec 7, 2014 #6

    DavidSnider

    User Avatar
    Gold Member

    I would probably learn C first.

    C is missing a lot of the features of modern languages, but it's kind of hard to appreciate why the modern features exist if you haven't worked in a language like C. After writing a few real applications in C you'll find yourself wishing that the compiler knew how to do things like allocating and deallocating memory automatically or protect you from putting arbitrary non-sense data into the memory of typed variables.

    Also, since C is fairly simple language it won't take as long to learn and will put you on a solid foundation for learning C++ or C# or Java.
     
  8. Dec 7, 2014 #7

    Mark44

    Staff: Mentor

    And after writing a few applications in C++, you'll find yourself wishing that the compiler didn't know how to do things like creating constructors, copy constructors, and destructors and such, especially when you neglect to explicitly create them yourself. About ten years ago I saw an internal Microsoft white paper giving reasons for implementing Windows kernel functionality in C versus C++. One of the main reasons given involved the greater complexity of the code produced by the C++ compiler, as well as the difficulty in predicting the size of the final object code, including the code added by the compiler for constructors, copy constructors, and destructors.

    I'm not arguing for the superiority of one language over another, just saying that each one has its pros and cons. In any case, it's pretty difficult to get a pure C compiler these days. Most of the ones that I know about have a backend that accepts code written in C or C++.
     
  9. Dec 7, 2014 #8

    DavidSnider

    User Avatar
    Gold Member

    Not sure what counts as 'pure', but GCC will accept flags like -std=c89 and -pedantic.
     
  10. Dec 7, 2014 #9

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    Totally agree. No programmer's career was ever hurt by learning C.

    The exception is for a person looking only for a special purpose language (MATLAB for Scientists/Engineers, SAS for statisticians, etc.)

    P.S. I have looked at some comments in the other related threads and IMO we aren't doing anyone a favor by sending him down that rabbit hole.
     
  11. Dec 7, 2014 #10
    Learning the very first programming language = learning programming. I would even rephrase that: while learning the first language, the objective is not the language; it is programming. So keep your options open. Do not ever think that the first language you learn will be the one that you will use in your first gainful employment.
     
  12. Dec 7, 2014 #11
    Hi, SK

    I didn't realize there were multiple kinds of programming. I'm curious now what are the different types? I figured there was just one basic type and that I'd try and learn a language that was very useful.

    I own a PC and so would be interested in learning how to program for PCs.

    Hey, FC

    So, you're the second person mentioning a distinction between types of languages. How do general purpose ones differ from special purpose ones? Any examples of the two types?

    Your recommendation to start with C and then C++ sounds very logical, by the way. Sounds like it could be a good starter language and I'll research it a little before deciding. Thanks for the recommendation though!

    By the way, how do you pronounce C#?
     
  13. Dec 7, 2014 #12

    DavidSnider

    User Avatar
    Gold Member

    Some programming languages are what they call "domain specific" meaning they were designed for a specific purpose in mind. You could think of HTML as a domain specific language for the markup of web pages. Or something like Matlab which was designed specifically for solving math problems.

    A general purpose programming language won't be geared towards any particular domain but can be used across domains.

    C# is pronounced See-Sharp.
     
  14. Dec 7, 2014 #13
    Will do, jtbell. Thanks for the rec.

    ....Out of curiosity, why isn't there one super language that combines all the strengths of the others? If individual languages exist, why not just create a "super" language out of them all?
     
  15. Dec 7, 2014 #14

    DavidSnider

    User Avatar
    Gold Member

    Because strengths in one domain might be weaknesses in another. There are trade-offs.
     
  16. Dec 7, 2014 #15

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    An example of a special purpose language is MATLAB for math and engineering. As a built in part of the language, you can make equations with a mixture of real numbers, vectors, and matrices. You can define vectors X = [ 1 2 3]; Y = [4 5 6] ;and write an equation A = 5*V + Y . It will calculate the vector A = [9 15 21]. Another specialized language is SAS for statistics analysis. An example is at this link: https://onlinecourses.science.psu.edu/stat480/node/9

    These languages are specific for certain applications so they can make assumptions about what you want and mean in your programs. General purpose languages can't make those assumptions. That gives the specialized language a big advantage in their field, but they can't do other things easily. There isn't a reason to make a "super language" because people in one field only want to learn and use a language for that field.
     
  17. Dec 7, 2014 #16
    Thanks again, FC.

    Lastly, any recommendations for how/where to get started learning C? Books?...online?...etc.? I'm going to try to get a start over winter/Christmas break prior to next term.
     
  18. Dec 7, 2014 #17

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    There are several major types of programming.

    Games and other recreational diversions are usually heavily dependent on graphics to provide a realistic simulation of some type of competitive situation. Ancient text based games like Zork just won't cut it with modern gamers who prefer realistic simulations.

    Scientific programming is oriented to making extended and complex numeric calculations with as much accuracy as possible. Often, a relatively small amount of input data can generate massive amounts of output data, so much so, that interpreting the results may require their presentation in graphical form. Because the numerical techniques used in scientific calculations are crucial to generating timely and accurate output, this type of programming usually requires programmers to be more technically proficient not only with programming languages, but also the underlying science of numerical analysis and a familiarity with scientific subjects.

    Business programming usually doesn't require handling computationally complex situations like scientific computing, but often one must manage large databases of financial or other business records. Being familiar with the techniques for handling, accessing, and organizing large amounts of data is usually a plus for the business programmer.

    There are other types of programming, but these will give you an idea of what to expect.
     
  19. Dec 9, 2014 #18
    Thanks, SK, for the explanation above!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: What is Best Computer Programming Language to Learn?
Loading...