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

Specific programming language

  1. Apr 25, 2012 #1
    I just finished all of my finals today, and now the summer is here! I am in a REU for the semester, and I should have plenty of time to learn a programming language. So, this afternoon, I googled around a bit for information.... and I can't figure out what to do! I was debating on Java, Python, or C/C++. I was going to first check out Python since I know it's sort of a user-friendly first-language option, but there are so many versions of the language, and just so many compilers...

    Someone help me out here, what specifically should I be looking for? If I search amazon for a programming book, there are many different ones on different versions of each language. Is python a good place to start, and if so, what is the current version and which compiler is worthwhile? If not, then the same question about the suggested language.

    Thanks!
     
  2. jcsd
  3. Apr 25, 2012 #2
    I will always recommend Python as a starting programming language. It's so easy to pick up in comparison to others languages, mostly because of syntax and less tech jargon. Plus they have an awesome tutorial here:

    http://docs.python.org/tutorial/

    It doesn't really matter which version you download just make sure there is a tutorial for it and you're good. Good luck.
     
  4. Apr 25, 2012 #3
    Thanks DA.

    I actually have some experience with programming. Specifically using C# for what it's worth, and I was a professional with Adobe/Macromedia Actionscript 3.0 and prior some time ago, though that's not entirely related. The tech-stuff wouldn't bother me too much. I know the basics of programming already, would python still be a good start? Or should I concern myself with one of the C's.
     
  5. Apr 25, 2012 #4
    Well, IMO, it depends on what you are planning to do with the language.

    As DA said, Python is always a good first language. In fact, scripting languages tend to be good first languages as they allow you to get your feet wet. My first was Java. Java has its uses and it a good language, but I prefer C. C is a really great language but it comes with a steep learning curve. Also, C++ is great and you don't really need to know C to learn C++ (though you will appreciate C++ much more if you already know C.) I also know a little matlab and fortran. These are really great if you are doing some sort of scientific/numerical programming. Matlab takes care of a bunch of stuff that is hard in C. As a specific example, doing matrix multiplication is trivial in matlab but not so much in C (it isn't very hard, just sort of tedious.)

    To answer your question, I like C. I'd learn C because if you know C, it will be relatively easy to learn other languages. The only downside is that C is not Object Oriented (well, it does not naturally support Objects) whereas Java and C++ are. However, I don't think this is a huge disappointment.
     
  6. Apr 25, 2012 #5
    What really makes C better than Java? OOP is pretty helpful. I was under the impression that Java can do basically everything C can, perhaps slower. I'm not looking to make some awesome optimized code. I was looking to learn some basics and then try to make a line integral calculator or something as a first project.
     
  7. Apr 25, 2012 #6
    Ahh gotcha. I know C fairly well but I would rather code in Python although since I'm an EE major, C is the most useful for me to know. I have no experience with Java and barely any with C++ so I can't comment on those.

    Here's some free books with numerical applications I've found:

    http://www.nr.com/oldverswitcher.html

    Google "Numerical Methods for Python" and you'll find another free book

    I guess it depends on what your eventual goals are. For me, I found that a research group I'm interested in uses C++ extensively so this summer C++ and numerical methods is on the to-do list. :smile:
     
  8. Apr 25, 2012 #7
    Java is really great. It allows for pretty robust code and it allows developers to think very high-level. Additionally, it can be very useful when you have to deal with matricies and vectors (though matlab is still much better.) This is because the Java takes care of a lot of the underlying details of array implementation.

    I suggested C simply because I like it more, and for several reasons. 1) It is what a programming language "should" be. That is not to say that there aren't problems. 2) Knowing C will really help you understand stuff in other languages. For example, when I was learning Java, I had no idea what a pointer was, but everyone kept saying "object names are pointers to data, not the actual data" I didn't really get what this was about until I learned C. 3) To know C, you have to learn more about how a computer works, specifically with respect to how memory is organised and used. 4) If you get to know C, then you will be able to talk intelligently about pretty much every other language. That's not to say you will know every other language. 5) Pointers are a really great feature of C and, for me, are the only things that I miss in Java. 6) IMO, knowing C is kind of like knowing Algebra: It might not be directly applicable to whatever you are doing, but you get a good glimpse of what is happening under the hood, specifically when you are wanting to analyse algorithms.


    Additionally, it is sort of like a language that everyone should know (all technical people, that is.) Again, not really because you will "need" to use it, but more for the same reason we read novels by Charles Dickens, and others.


    So, these are the reasons I suggested C. However, learning Java would also be a really good idea. Once you have learned your nth language, the (n+1)th is easier to learn. So, it might be wise to learn something like Java or Python, and then learn C.


    But, like I said, most of it depends on what you are going to be doing. For example, I used Java for one project and C for another. Sometimes when I am doing numerical stuff I use C, sometimes matlab, occasionally Java or Fortran (usually those two to keep my skills semi-sharp, but they aren't too sharp and never have been with Fortran.) But, for a general purpose language, I will always go with C.
     
  9. Apr 25, 2012 #8
    Oh, if you decide to learn C, I suggest a few things:

    1) Make your computer a dual boot with Windows / Linux (preferably Ubuntu)
    2) Code on the Ubuntu side and us the gnu c compiler (this comes with Ubuntu)
    3) Edit code in Vim (or, if you are *evil* you could use Emacs) in the command prompt
    4) Get the books: The Unix Programming Environment (nearly all of it will be applicable to your Ubuntu box), A Book On C (the one by Kelley), The C Programming Language (by K&R).

    This also has a pretty steep curve, but learning to program in a text editor (as opposed to an IDE) will help you learn the language better. Also, once you start editing in vim (or the evil emacs) you will not want to go back to any "regular" text editor.
     
  10. Apr 25, 2012 #9

    jtbell

    User Avatar

    Staff: Mentor

    Ask four programmers which programming language to learn and you'll get at least six recommendations. :rofl:
     
  11. Apr 25, 2012 #10

    jhae2.718

    User Avatar
    Gold Member

    I like the standard C Python. There's a great standard library, then add NumPy/SciPy/matplotlib and you're good.

    Compiled languages, go* C and gcc.

    *As in the verb 'to go', but the Go language looks rather interesting.
     
  12. Apr 26, 2012 #11
    What do you mean by gcc? That's not a language; that's a compiler for C. I'm guessing you just meant "go, or C with gcc" is that correct?
     
  13. Apr 26, 2012 #12

    jhae2.718

    User Avatar
    Gold Member

    I mean write C and compile with gcc.
     
  14. Apr 26, 2012 #13
    Haha, yes.



    QuarkCharmer, the most important thing is that you know how to program generally. Any of the languages you and others have suggested so far would be fine. At the end of the day, you'll need to learn multiple languages anyways, so I would recommend picking one language and sticking with it for a while so that you can learn how to program well. After this you can pick up other languages as you need them. You'd even be fine sticking with C# for now, if you already have some experience with it.

    I learned Java first, because that's what was taught at my university. In practice (I'm a student working on projects in computational solid state physics), I use some combination of fortran, perl, mathematica, and tc shell scripting.
     
  15. Apr 26, 2012 #14

    chiro

    User Avatar
    Science Advisor

    Hey QuarkCharmer.

    My recommendation is that if you have learned C#, you might as well learn C++. Learning all the intracacies with templates, class construction, inheritance (you can do multiple inheritance as well but it's not recommended in most situations) as well as basically going down to the bone in terms of memory management, debugging, and also since you can use DLL's compiled from any language, you get to work with trans-language issues if you chose to do so, which is important for many legacy applications that use multi-language repositories.

    Those are the big things IMO although there are more things in C++ aside from these and if you are interested in bare-bones OOP where you have to do most things yourself (and also work in a multi-language environment with say Fortran or Pascal DLL's from C++ environment or use some kind of custom SDK), then this would be a good language to learn.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Specific programming language
  1. Programming Languages (Replies: 19)

  2. Programming language (Replies: 10)

  3. Programming languages (Replies: 16)

Loading...