most useful programming language to learn?
most useful programming language to learn?
Hi, I'm an undergraduate freshman and was looking at some pages for REUs. Most of them say that they prefer applicants to have experience with a high level programming language. What would be the most useful/reasonable language for me to self-teach myself this summer, for both REUs and eventually grad school?
Thanks for the help
Thanks for the help
Re: most useful programming language to learn?
Fortran!! ... I am going to do some research for first time, and all the work is in Fortran....
I think there is lot of legacy code in physics in Fortran
I think there is lot of legacy code in physics in Fortran
-
- Posts: 249
- Joined: Sat Dec 20, 2008 9:34 am
Re: most useful programming language to learn?
FORTRAN??? Are you kidding?
FORTRAN may be useful to know at some point, but it's certainly not the best programming language for someone who is inexperienced to learn.
Better examples might be Python (incredibly useful as a scripting language in its own right), Java, or C++. All three of these languages have many intro level books you can learn from. I also think it will be worth it to take the introductory programming sequence at your school next year. Personally, I know it's easier for me to learn when there are set deadlines and structure as opposed to paging through a random book.
FORTRAN may be useful to know at some point, but it's certainly not the best programming language for someone who is inexperienced to learn.
Better examples might be Python (incredibly useful as a scripting language in its own right), Java, or C++. All three of these languages have many intro level books you can learn from. I also think it will be worth it to take the introductory programming sequence at your school next year. Personally, I know it's easier for me to learn when there are set deadlines and structure as opposed to paging through a random book.
Re: most useful programming language to learn?
Alot of that legacy code is being replaced with C++/or other more current implementations
example
http://home.thep.lu.se/~torbjorn/pythiaaux/present.html
example
http://home.thep.lu.se/~torbjorn/pythiaaux/present.html
Re: most useful programming language to learn?
I took a class in python last quarter, and I think that i'd learn a new one best on my own. I'm taking the verdict so far to be C++. Any more suggestions / disagreements?
Re: most useful programming language to learn?
This is a tough question because the most popular scientific programming language might still not be the best one for you to learn if it's your first language. I would say start with python, just because it is easy. Aside from that, C/C++ are probably the ones to go with. Maybe Java would also be good to learn since it is so similar to C++, but a bit easier.
- Kaiser_Sose
- Posts: 48
- Joined: Sun Sep 28, 2008 11:20 pm
Re: most useful programming language to learn?
My vote is for Python or Java.
I learned Java from a required course. It helped alot when I made the jump to Python for my research work. I'm not sure what would be the most instructive to start with as your first language, but I "enjoy" working in the python environment. Its easy to read for the most part. I can scan most Python codes and follow the execution; this is not the case for some other languages. Plus Python has the NumPy and SciPy libraries that let it serve as a poor man's Matlab. I can attest that the syntax from NumPy is ALOT like Matlab.
My vote.
KS
I learned Java from a required course. It helped alot when I made the jump to Python for my research work. I'm not sure what would be the most instructive to start with as your first language, but I "enjoy" working in the python environment. Its easy to read for the most part. I can scan most Python codes and follow the execution; this is not the case for some other languages. Plus Python has the NumPy and SciPy libraries that let it serve as a poor man's Matlab. I can attest that the syntax from NumPy is ALOT like Matlab.
My vote.
KS
Re: most useful programming language to learn?
Python, C, Fortran
Python is really a good language. Easy to learn and really useful.
Python is really a good language. Easy to learn and really useful.
Re: most useful programming language to learn?
It depends on where you are going.... in particle it is C++ or Python, in astronomy it is IDL, Fortran and C/C++, theory mostly works with fortran. So i dunno what is best for you, but IMO C++ is always a good way to go.
Re: most useful programming language to learn?
As a matter of fact, if you know how to program pretty well in any one programming language, it will take you just a few days to learn another one that you have never seen before. It is more important to understand how a structured program works, and then you can learn the specifics of another language on the fly. In fact, spending too much time on learning a specialized language (like IDL) or a legacy language (like Fortran) can be a waste of time unless you know for sure that you are going to work on some project that requires you to know that certain language.
I guess I'd thus side with C++ as well. This amazingly accessible and detailed book would be best to learn from:
http://www.amazon.com/How-Program-Harve ... 136152503/
Matlab is also good, it's easy yet very advanced, but probably is not generic enough. If you are interested but don't have access to it then you can substitute it with Octave.
Java, Perl, Python etc. are powerful generic languages but probably shouldn't be the first language you ever learn.
IDL (for general purpose), Supermongo (for plotting), R (for statistics), IRAF (for image processing) etc. are useful for astronomers.
Fortran, C, Basic etc. have now become legacy languages. Unless you have to deal with really old codes, you needn't bother.
Conclusion: Go C++
I guess I'd thus side with C++ as well. This amazingly accessible and detailed book would be best to learn from:
http://www.amazon.com/How-Program-Harve ... 136152503/
Matlab is also good, it's easy yet very advanced, but probably is not generic enough. If you are interested but don't have access to it then you can substitute it with Octave.
Java, Perl, Python etc. are powerful generic languages but probably shouldn't be the first language you ever learn.
IDL (for general purpose), Supermongo (for plotting), R (for statistics), IRAF (for image processing) etc. are useful for astronomers.
Fortran, C, Basic etc. have now become legacy languages. Unless you have to deal with really old codes, you needn't bother.
Conclusion: Go C++
Re: most useful programming language to learn?
When I was a PhD student we were all forced to learn Python, and use it continually throughout our courses. Very useful language ...
-
- Posts: 1
- Joined: Sat Oct 24, 2009 7:17 am
Re: most useful programming language to learn?
Hi Toodles.
Myself Jessica from United States of America, I am glad to know that you had ask very nice question regarding learning a High Level Programming Language. Well, I would like to insist you to learn the Basic of all High Level Programming language, which is C.All the High Level Programming Languages can be learned very fast if you are proficient in C programming.
Thanks for sharing your ideas with us all and stay in touch.
Myself Jessica from United States of America, I am glad to know that you had ask very nice question regarding learning a High Level Programming Language. Well, I would like to insist you to learn the Basic of all High Level Programming language, which is C.All the High Level Programming Languages can be learned very fast if you are proficient in C programming.
Thanks for sharing your ideas with us all and stay in touch.
-
- Posts: 12
- Joined: Mon Feb 06, 2012 12:09 am
Re: most useful programming language to learn?
So go with C++ first. You can get the free version of Visual Studio on Microsoft's website. Just look it up... Visual C++ Express.
An alternative is Matlab, which is is actually a more useful language, as far as I've seen, than C++ for any numerical work. C++ is better for making real programs for Windows. And C++ is faster for certain things, but once you start making matrix manipulations, you'd have to know where to get the libraries. With Matlab, everything gets set up automatically, so there's little work to do.
Once you learn your first language, if you wanted to do experiments, don't forget about LabVIEW. I don't like it very much - it's graphical, hence easy to learn, but slow to use, though the libraries for connecting to instruments is very helpful. I found it in every lab I've been in.
Btw, people actually *like* Python? I guess it's free... But it's very slow for anything numerical... I think Matlab is just so much better, with the integrated development environment. In any case, if you must do Python, you'd be doing yourself a huge favor by using an IDE, like Spyder in the package Python(x,y). Under no circumstances do you want to use the default IDLE for Python.
An alternative is Matlab, which is is actually a more useful language, as far as I've seen, than C++ for any numerical work. C++ is better for making real programs for Windows. And C++ is faster for certain things, but once you start making matrix manipulations, you'd have to know where to get the libraries. With Matlab, everything gets set up automatically, so there's little work to do.
Once you learn your first language, if you wanted to do experiments, don't forget about LabVIEW. I don't like it very much - it's graphical, hence easy to learn, but slow to use, though the libraries for connecting to instruments is very helpful. I found it in every lab I've been in.
Btw, people actually *like* Python? I guess it's free... But it's very slow for anything numerical... I think Matlab is just so much better, with the integrated development environment. In any case, if you must do Python, you'd be doing yourself a huge favor by using an IDE, like Spyder in the package Python(x,y). Under no circumstances do you want to use the default IDLE for Python.
-
- Posts: 381
- Joined: Mon May 24, 2010 11:34 pm
Re: most useful programming language to learn?
I use java all the time. For example, if I want a graph in a paper, I write a java applet that produces the LaTeX file for the graph. For this purpose, the applet is trivial. Java lets you make the applet more useful. So I can create "pocket calculators" that help me do calculations.
The important features are that java can run on any machine, it does graphics, and it allows you to create a convenient user interface. It's primary disadvantage is that it's slow. But for very few calculations has this ever been a problem for me, most calculations are too simple to care about efficiency.
Before I used java as my primary language I used Turbo Pascal as this also did graphics. And before that it was Fortran.
The important features are that java can run on any machine, it does graphics, and it allows you to create a convenient user interface. It's primary disadvantage is that it's slow. But for very few calculations has this ever been a problem for me, most calculations are too simple to care about efficiency.
Before I used java as my primary language I used Turbo Pascal as this also did graphics. And before that it was Fortran.
Re: most useful programming language to learn?
Learn C, all the rest are derivatives, kind of..
-
- Posts: 1203
- Joined: Sat Nov 07, 2009 11:44 am
Re: most useful programming language to learn?
Not really true, object oriented maybe, but idl and numpy'd python are totally different.mrrsnhtl wrote:Learn C, all the rest are derivatives, kind of..
Re: most useful programming language to learn?
Personally (have bs in physics) my plan is to learn python (I have some coding experience from high school but that's it) until I'm pretty comfortable with it, then transition to whichever will be the most helpful at that point. Python seems to have the easiest syntax to learn but won't be sufficient if I end up using programming a lot as a grad student.
-
- Posts: 1203
- Joined: Sat Nov 07, 2009 11:44 am
Re: most useful programming language to learn?
It might, actually. Most of the time you end up just writing wrapper routines that call pre-existing optimized code already developed by the community (or professional computer scientists in the case of HEP) to do the specific analysis you need done. These wrapper codes don't really need to be fast, since they are generally only called once or a short few times, and with numpy's python-fortran and python-c++ functionality, you can probably get away with just python in the vast majority of circumstances.microacg wrote:Personally (have bs in physics) my plan is to learn python (I have some coding experience from high school but that's it) until I'm pretty comfortable with it, then transition to whichever will be the most helpful at that point. Python seems to have the easiest syntax to learn but won't be sufficient if I end up using programming a lot as a grad student.
As far as codes that are used in the scientific community, you're totally right that Python is easiest, probably followed by IDL, which has the major disadvantage that it's proprietary. Both languages are actively compiled, so you don't have to do things like declare variables, etc. My guess is python will be the language of choice for almost every physicist in the next 10 years, with only a small few actually working on the c++ code that forms the backbone of most analysis packages.
Re: most useful programming language to learn?
I was going to say this myself too! But a lot of times you might also have to work with whatever code you're given. In my case, it means I get to work with FORTRAN77, a language 10 years older than me!bfollinprm wrote:My guess is python will be the language of choice for almost every physicist in the next 10 years, with only a small few actually working on the c++ code that forms the backbone of most analysis packages.
However, that old generation of profs will eventually retire out and replaced by us, many of whom are using python (although I still need to learn it myself). But I bet graduate students 30-40 years from now will think of python the way we think of FORTRAN!
-
- Posts: 1203
- Joined: Sat Nov 07, 2009 11:44 am
Re: most useful programming language to learn?
f2py -c <fortranfile>.f90 -m <fortranfile>.pyf Done and done!TakeruK wrote:I was going to say this myself too! But a lot of times you might also have to work with whatever code you're given. In my case, it means I get to work with FORTRAN77, a language 10 years older than me!bfollinprm wrote:My guess is python will be the language of choice for almost every physicist in the next 10 years, with only a small few actually working on the c++ code that forms the backbone of most analysis packages.
Re: most useful programming language to learn?
Well, to me, python and similar ones are developed for the non-programmers. No doubt that it is way useful for physical (or chemical, aeronautical, etc.) applications. Yet, C dwells at the heart of the object. Always nice to grasp fundamentals..bfollinprm wrote:Not really true, object oriented maybe, but idl and numpy'd python are totally different.mrrsnhtl wrote:Learn C, all the rest are derivatives, kind of..
-
- Posts: 1203
- Joined: Sat Nov 07, 2009 11:44 am
Re: most useful programming language to learn?
Let's look at languages and their primal elements:mrrsnhtl wrote: Well, to me, python and similar ones are developed for the non-programmers. No doubt that it is way useful for physical (or chemical, aeronautical, etc.) applications. Yet, C dwells at the heart of the object. Always nice to grasp fundamentals..
C/C++/Java/Perl -- object/location oriented
Fortran -- object oriented
Haskell--Function oriented
Lisp--list oriented
IDL/J/R -- array oriented
SQL, etc -- Map oriented
Postscript/Joy -- Stack oriented
All these have their uses, don't have obvious connections to each other, and are definitely not all developed for "non-programmers"*. No need to use C when something like an array oriented language like IDL/numpy/R/Lisp will do the same thing just as fast (if not faster), and with 1/100th as much code. C and Java are popular not because they're always the best or even representative, but because they're taught in computer science, are fairly extendible, and easier to understand than more natural machine-language extensions like Lisp and Haskell.
*of this list, I'd say only R counts as for non-programmers.
Re: most useful programming language to learn?
That's what I'm talking about. They are thought first, because they are fundamental. They are extendible because of their plain structure, or coding algorithm..Other 'faster' or more efficient ones are a few level higher than C, so they are quite more useful of course..Personally, I also prefer not to use C say for a modeling. It is like trying to model mitosis process with quantum mechanics (=bfollinprm wrote:..C and Java are popular not because they're always the best or even representative, but because they're taught in computer science, are fairly extendible, and easier to understand than more natural machine-language extensions like Lisp and Haskell..