most useful programming language to learn?

Toodles
Posts: 10
Joined: Thu Sep 11, 2008 5:12 pm

most useful programming language to learn?

Postby Toodles » Mon Jun 15, 2009 6:33 am

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

User avatar
xudis149
Posts: 148
Joined: Thu Jun 12, 2008 12:03 am

Re: most useful programming language to learn?

Postby xudis149 » Mon Jun 15, 2009 8:25 am

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

nathan12343
Posts: 249
Joined: Sat Dec 20, 2008 9:34 am

Re: most useful programming language to learn?

Postby nathan12343 » Mon Jun 15, 2009 7:08 pm

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.

cato88
Posts: 420
Joined: Wed Sep 03, 2008 12:46 am

Re: most useful programming language to learn?

Postby cato88 » Mon Jun 15, 2009 8:33 pm

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

Toodles
Posts: 10
Joined: Thu Sep 11, 2008 5:12 pm

Re: most useful programming language to learn?

Postby Toodles » Mon Jun 15, 2009 9:34 pm

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?

WakkaDojo
Posts: 41
Joined: Sat Dec 06, 2008 11:10 am

Re: most useful programming language to learn?

Postby WakkaDojo » Mon Jun 15, 2009 10:04 pm

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.

User avatar
Kaiser_Sose
Posts: 48
Joined: Sun Sep 28, 2008 11:20 pm

Re: most useful programming language to learn?

Postby Kaiser_Sose » Tue Jun 16, 2009 12:03 am

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

arfken
Posts: 10
Joined: Sat Jan 10, 2009 4:41 am

Re: most useful programming language to learn?

Postby arfken » Tue Jun 16, 2009 9:10 am

Python, C, Fortran

Python is really a good language. Easy to learn and really useful.

User avatar
Helio
Posts: 809
Joined: Thu Mar 15, 2007 7:11 pm

Re: most useful programming language to learn?

Postby Helio » Tue Jun 16, 2009 7:49 pm

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.

shouravv
Posts: 84
Joined: Sat Feb 02, 2008 1:20 pm

Re: most useful programming language to learn?

Postby shouravv » Tue Jun 16, 2009 8:35 pm

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++

tnoviell
Posts: 235
Joined: Sun Nov 05, 2006 10:31 am

Re: most useful programming language to learn?

Postby tnoviell » Mon Jun 29, 2009 6:00 pm

When I was a PhD student we were all forced to learn Python, and use it continually throughout our courses. Very useful language ...

jessica414
Posts: 1
Joined: Sat Oct 24, 2009 7:17 am

Re: most useful programming language to learn?

Postby jessica414 » Sat Oct 24, 2009 8:35 am

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. :)

Failnaught
Posts: 12
Joined: Mon Feb 06, 2012 12:09 am

Re: most useful programming language to learn?

Postby Failnaught » Sat Apr 07, 2012 8:25 pm

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.

CarlBrannen
Posts: 381
Joined: Mon May 24, 2010 11:34 pm

Re: most useful programming language to learn?

Postby CarlBrannen » Sun Apr 08, 2012 3:07 am

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.

User avatar
mrrsnhtl
Posts: 79
Joined: Mon Jun 27, 2011 4:27 pm

Re: most useful programming language to learn?

Postby mrrsnhtl » Sun Apr 08, 2012 9:13 am

Learn C, all the rest are derivatives, kind of..

bfollinprm
Posts: 1197
Joined: Sat Nov 07, 2009 11:44 am

Re: most useful programming language to learn?

Postby bfollinprm » Sun Apr 08, 2012 12:12 pm

mrrsnhtl wrote:Learn C, all the rest are derivatives, kind of..

Not really true, object oriented maybe, but idl and numpy'd python are totally different.

microacg
Posts: 62
Joined: Sat Mar 03, 2012 2:06 pm

Re: most useful programming language to learn?

Postby microacg » Sun Apr 08, 2012 2:57 pm

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.

bfollinprm
Posts: 1197
Joined: Sat Nov 07, 2009 11:44 am

Re: most useful programming language to learn?

Postby bfollinprm » Sun Apr 08, 2012 3:32 pm

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.


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.

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.

TakeruK
Posts: 813
Joined: Mon Jan 02, 2012 3:05 pm

Re: most useful programming language to learn?

Postby TakeruK » Sun Apr 08, 2012 8:17 pm

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.


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!

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!

bfollinprm
Posts: 1197
Joined: Sat Nov 07, 2009 11:44 am

Re: most useful programming language to learn?

Postby bfollinprm » Sun Apr 08, 2012 8:21 pm

TakeruK wrote:
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.


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!


f2py -c <fortranfile>.f90 -m <fortranfile>.pyf Done and done!

User avatar
mrrsnhtl
Posts: 79
Joined: Mon Jun 27, 2011 4:27 pm

Re: most useful programming language to learn?

Postby mrrsnhtl » Mon Apr 09, 2012 6:33 am

bfollinprm wrote:
mrrsnhtl wrote:Learn C, all the rest are derivatives, kind of..

Not really true, object oriented maybe, but idl and numpy'd python are totally different.


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
Posts: 1197
Joined: Sat Nov 07, 2009 11:44 am

Re: most useful programming language to learn?

Postby bfollinprm » Mon Apr 09, 2012 2:19 pm

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..


Let's look at languages and their primal elements:
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.

User avatar
mrrsnhtl
Posts: 79
Joined: Mon Jun 27, 2011 4:27 pm

Re: most useful programming language to learn?

Postby mrrsnhtl » Tue Apr 10, 2012 11:45 am

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..


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 (=




Return to “Research”

Who is online

Users browsing this forum: No registered users and 1 guest