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

Which one [language] next?

  1. Oct 6, 2013 #1
    I have just finished an intro course on Python. As most others, I have the goals of learning Java, C and C++. In what sequence should I learn them? I am inclined on learning Java first as it is a prereq for some courses that I am eager to take. Yet, is it what you would recommend?
    Note: I loved Python(if that would help in choosing which I should take first)
     
  2. jcsd
  3. Oct 6, 2013 #2

    phinds

    User Avatar
    Gold Member
    2016 Award

    I suggest C first, as it is the only non-OO language on your list and is the syntactical basis for C++, Java, JavaScript, and other languages.
     
  4. Oct 6, 2013 #3

    jim mcnamara

    User Avatar

    Staff: Mentor

    I would second that suggestion. You also need to remember that in a career you will probably bounce around using different technologies and language frameworks. I started with COBOL and FORTRAN long ago. Now I use C and specialty languages like dtrace.
     
  5. Oct 6, 2013 #4
    Thanks!
     
  6. Oct 7, 2013 #5
    I third that suggestion. Learn C, then learn Java. Good luck.
     
  7. Oct 7, 2013 #6

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    I'm inclined to disagree with that. If you learn enough C to write useful programs, you will have to "unlearn" most of what you learned about pointers to write good C++, and all it to write any kind of Java.

    Just because C came first historically, that doesn't mean it's the place to start learning. Otherwise, why not start teaching 5 year olds Sanskrit and Latin in school, and leave Engiish till later on?
     
  8. Oct 7, 2013 #7

    phinds

    User Avatar
    Gold Member
    2016 Award

    I agree w/ you about pointers but that's about the ONLY thing in C that's like that. My point is that it is best to learn the fundamental syntax of a language before you start piling on OO concepts which are a bit complex for beginners. AND, C is the basis for many modern languages.

    Why do you figure so many people agreed w/ my suggestion?
     
  9. Oct 7, 2013 #8
    I agree with Phinds. I learned C and knowing pointers did not slow me down in any way for learning Object Oriented Programming.
     
  10. Oct 7, 2013 #9

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    A different tack: Don't learn to program in another language. Learn to program, period. If you are going to college, almost every college will offer a course (or courses) in algorithms and data structures, and another course (or courses) in numerical methods, and yet another in structured programming. Those classes are worth a whole lot more than learning to program (badly) in yet another language.

    People at this site oftentimes have the mistaken notion that you can learn to program on your own. Yes, you can learn to program badly on your own. It's easy. I see these (non) programmers all the time. You can also learn to program badly by using cargo cult techniques where you follow examples by others who learned to program on their own.

    Can you learn how to program well on your own? Yes, but it's just about as likely as learning general relativity on your own.
     
  11. Oct 7, 2013 #10

    Cod

    User Avatar

    Is there a reason you want to learn another language? Why not go into some more advanced Python before moving on? Python is very robust and offers a lot to the science community via SciPy.

    Also, like D H stated above, learn to program and worry about language specifics second.
     
  12. Oct 8, 2013 #11
    Writing good C++ does not mean ignoring pointers. You have to know what they are, and you have to do your memory management. It is true that many good libraries (and to some extent coding styles and conventions) lessen the burden, but to appreciate their utility and even to choose rationally which one is to be used, one still has to be cognizant of these matters. Creating good C++ libraries, on the other hand, pretty much requires one to embrace all these intricacies.

    More generally, one principal difference between C/C++ and Java (or C#) is that the former works on the "bare metal", giving direct unsafe and unchecked access to memory, and supporting unsafe and unchecked type conversions. Learning and using this trait of the language is essential for mastery of C++; otherwise, there is simply no reason to bother ever studying it, because everything else can be done comfortably with a "safe" language.

    C and C++ are difficult as first languages, because one has to study "basic programming" and the language at the same time. A "Hello, World" program already uses pointers and it gets worse.
     
  13. Oct 8, 2013 #12

    harborsparrow

    User Avatar
    Gold Member

    Whatever language you use, it pays to learn what is really going on in memory. Python, and to some extent Java, try to protect you from needing to know that. But ultimately, it pays to know, especially if you ever need to be concerned about performance. C++ will require you to learn how things are being stored--and more detail than you'll like, so it will take longer to become competent with it. But likewise, in Java (and other object oriented languages) the way the objects consume memory (and their lifetimes in your programs) is very important.

    Good luck! All good languages.
     
  14. Oct 8, 2013 #13

    jedishrfu

    Staff: Mentor

    Or you could consider learning Scala which has been described as a better Java than Java. It has features of scripting languages and forces you to think more about how to do things in OO and in functional programming:

    http://en.wikipedia.org/wiki/Scala_(programming_language)

    The argument for C vs Java just reminds me of the decades old one of C vs Assembler... basically the new generation language versus the old generation language learned by the older generation.
     
  15. Oct 29, 2013 #14
    c# or java/scalar then c++
     
  16. Oct 29, 2013 #15
    C is still used for systems software and hardware drivers. Even if that may not interest you, there is still lots of existing C code that one may need to interact with, particularly libraries. Sometimes you can get away without actually writing C code (by using ctypes, cython, or other helpers), but you still need to understand C code.
     
  17. Oct 29, 2013 #16
    Why learn C if C++ exists? Not to be obnoxious or malicious...
     
  18. Oct 29, 2013 #17

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    If you want an obnoxious answer, ask Linus Torvalds.

    For a less obnoxious answer, C and C++ are very different languages that have some superficial similarities. It takes at least a year, and often two or more years, for a proficient C programmer to become proficient in C++. It's a hard transition. It takes even longer for a proficient C++ programmer to become a proficient C programmer. Going from C++ to C is even harder than going from C to C++.
     
  19. Oct 29, 2013 #18
    For most intents and purposes C can do anything C++ can do, considering that he's doing it for a hobby(I think). and C++ is easier than C as it shares more similarities with the other languages (I dunno about pythn have only done super simple calculating things in it.)
     
  20. Oct 29, 2013 #19
    C can do anything any other language do. So can C++. So can many other languages. This is mot a property that makes a lot of difference these days.
     
  21. Oct 29, 2013 #20
    But if c++ is easier and more widely used don't you think that's what he should learn?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Which one [language] next?
  1. Which One? (Replies: 2)

Loading...