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.

Once day, I talked to my Prof. about Computational Physics and he showed me his work. I'm quite surprised that why Prof. use C++ for computation because C++ quite complicated. I heard he talked about memory talk about pointer. Why didn't he use Python or Java that more easier? no need to manage memory no need to busy with pointer.

share|improve this question
3  
The reason is probably historical. –  Bernhard Aug 11 '13 at 10:38
2  
1  
This is not a question about Physics. Programming is engineering, which is off-topic here. –  Deer Hunter Aug 11 '13 at 10:44
3  
This question appears to be off-topic because it is about programming languages, not physics concepts. –  Chris White Aug 11 '13 at 12:31
    
In my experience, people mostly use Fortran, Matlab and Python for this. C++ is not really that popular (maybe there has been a slight increase recently, if you count CUDA as C++). –  Bogdan Aug 11 '13 at 12:32
show 4 more comments

closed as off-topic by Kostya, Dilaton, Chris White, Emilio Pisanty, David Z Aug 11 '13 at 16:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be about engineering, which is the application of scientific knowledge to construct a solution to solve a specific problem. As such, it is off topic for this site, which deals with the science, whether theoretical or experimental, of how the natural world works. For more information, see this meta post." – Kostya, Dilaton
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 10 down vote accepted

I can't really know why your professor used C++, but there are several reasons why you would:

  • Performance: Scientific computations might require top-notch performance. C++ allows for very low level control over the hardware and has many possibilities for micro-optimization while still providing high-level abstraction. Of course, this is also the reason that C++ is quite complicated.
  • Historical reasons: C++ has been the de facto general programming language for quite a while. Your prof's code might need to be compatible with other projects. Plus, I think there are more libraries for C/C++ than for any other language, your professor might have to make use of such a library. It is also possible that C++ is the standard language for this kind of thing in your professor's university or field, simply because it used to be the best choice.
  • Maybe your professor only knows C++...
share|improve this answer
6  
+1 for the latter . ' –  Dimensio1n0 Aug 11 '13 at 11:14
add comment

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