Take the 2-minute tour ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free, no registration required.

From the vantage point of a physicist and the kind of problems he would like a computer program to solve, what are the essential programming languages that a physicist should know.

I know C++ and I have worked in ROOT. I have also found Mathematica quiet essential, however since shifting to a linux machine I've been trying Sage which is also good, though not quiet at the same level right now. I have found C++ to be really fast, efficient, and best suited for stuff like Monte Carlo simulations. However, it appears that scimpy is also quiet popular. Would it be worthwhile to invest time in learning python, i.e would it have significant gains?

I also find the concept of functional programming languages much appealing. I think physicists unlike many programmers are more inclined to think this way rather than iteratively. Haskell sounds like a good candidate and I've also heard that it is ideal for simulating quantum algorithms on classical machines. Is anyone familiar with it?

Also what about scripting languages? I do not know any of those, except basic directory navigation in bash. Is there any utility in Perl and whatever is out there (I know little about these)

share|improve this question

closed as off topic by dmckee May 25 '11 at 16:52

Questions on Physics Stack Exchange are expected to relate to physics within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
You might be able to glean some helpful information from Practices for programming in a scientific environment? on Stack Overflow. –  dmckee May 25 '11 at 16:54
11  
It seems on topic to me. The OP wants input specifically from physicists. However, I prefer questions not to ask so many different things all at once. (Aside: if you're using SAGE, you're already using Python.) –  Mark Eichenlaub May 25 '11 at 21:44
    
MATLAB is more or less essential as a prototyping platform and C/C++ certainly if you want to perform more customized numerical calculations in your research. –  BjornW May 25 '11 at 22:48
1  
Approximist has opened a topic on meta to discuss the proper state of this question. Please jump in. –  dmckee May 26 '11 at 0:46
2  
@dmckee After giving it some thought, I no longer appeal the closure. I have added my perspective on the meta post. –  Approximist May 28 '11 at 4:09

1 Answer 1

In computational physics (and other computational disciplines), not enough attention is paid (much of the time) to reproducibility issues and too much is paid to execution speed. The main advantage of "literate" languages like Python is that it is pretty easy to write readable, easily documentable, and testable code, and to do so quickly. That makes it more likely that the code is "correct", and more likely that others will be able to understand what you have done (basic requirements in experimental work). At the very least, python and other high level languages like it are great for prototyping algorithms before spending the effort to fine tune C++ or fortran code -- and for many tasks where execution speed doesn't matter at all, one might as well do all the work "literately".

Check out the Software Carpentry project (http://software-carpentry.org/) for more on scientific computing, reproducibility, and Python.

share|improve this answer
2  
Stack Overflow has some commentary on matter of reproducibility at Reproducibility in scientific programming. –  dmckee May 25 '11 at 16:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.