Programming languages used by physicists?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 6K views
BigD
Messages
14
Reaction score
0
It is suggested that I learn a computation oriented programming language for an physics internship which I hope to apply for soon. I'm curious; what is the most commonly used programming language in the physics community?

I've heard that Fortran has been used extensively for a some time, but all of the material discussing Fortran that I've found online is quite old. Is there something else that has replaced it?
 
Physics news on Phys.org
Depends what area and where in your career.

New grad student = Mathematica, Matlab, Excel

New post doc = c++

Senior lecturer = Fortran

Professor = the highest level programming language "grad student". It only has one statement which is "hey you - write me a program to do X"
 
Thank you. I actually haven't finished 4-year yet, but I love reading things beyond my level.

P.S. Thanks for the quick laugh.
 
There was almost a serious point - It depends on your life goal!

If you want to get on in physics you probably want to do as little programming as possible, there are better things to do than be in the lab at 4:00am looking for that intermittent memory bug that only happens when your model has been running for 12hours.
Ideally if you can use something like Mathematics, matlab, IDL - or even Excel.

If you are going to end up on Wall St/industry like most of us then learning some python/C++/Linux is going to be useful.
 
The reason all of the material you found about Fortran being old is because Fortran is old. You will find that many languages in physics are used simply because they are used. IDL, for instance, is used for things like image processing - it's often said among the department I know that uses IDL extensively that the only reason they still use IDL is because no-one has bothered to write the processing routines in MATLAB.

Fortran is good at what it does, but I wouldn't recommend it as a first language. It's messy, takes a while to get used to and will feel utterly illogical for a while. Once you're comfortable with setting programming aside as being something a bit abstract in your mind, Fortran is OK - the reason it's still used is simply because the things it can do, it can do very fast.

I also, certainly, wouldn't say you're reading above your level by learning programming - you mean you haven't dealt with any of those mentioned above as part of your course material? I was introduced to MATLAB in year one and had projects in it every year, as well as a bunch of others.

I would recommend you start with MATLAB. It's used extensively in physics, applied mathematics and engineering and is a great language to begin with. It's fairly easy to pick up, and many of the skills you'll learn in MATLAB are transferrable to things like C++. The tutorial system and built-in help are also pretty reasonable.
 
mgb_phys said:
Depends what area and where in your career.

New grad student = Mathematica, Matlab, Excel

New post doc = c++

Senior lecturer = Fortran

Professor = the highest level programming language "grad student". It only has one statement which is "hey you - write me a program to do X"

Are you speaking from a condensed matter standpoint? For those of us in high energy, even we grad students have to know C++.