views:

412

answers:

5

I'm currently taking a math class in College called "Scientific Computing" and the professor told us that C is the most common language used for, well, scientific computing and am just wondering as to how accurate this professor is?

+4  A: 

From what I have heard Fortran is very common for scientific purposes, but C is general purpose enough that for some it is a good solution for most any type of programming.

ghills
+17  A: 

In my business (particle physics) we pretty much moved from fortran 77 straight to c++ and python. Those of us who care about programming all know c, but it is only written for niche applications (embedded DAQ boards, special purpose drivers, ...).

But learning c will give you a firm foundation for programming, and it is rarely profitable to argue with professors.

dmckee
"and it is rarely profitable to argue with professors"... lol
lubos hasko
+1 I would have written something similar (coming from a particle physicist in training ;-).
David Zaslavsky
+8  A: 

I don't think that your professor's answer is serving you well even if it is correct.

In my experience as a consultant for scientific computing and data systems C is certainly used a lot, but so are Fortran and C++. Python is by far the most commonly used scripting language.

I think that this is going to change. The big deal now is parallel computing and this is painful (MPI anyone?) in the traditional languages I've mentioned. My speculation is that a lot of the parallelization will (and should) be moved to virtual machines: Java or .NET; i.e., I think that parallelization should be the JIT's job. Whether that will be enabled with, say, Fortress, or one one of the traditional languages, I don't know. Intel is pushing parallel tools for C/C++, but I wonder if something like Terracotta might better in the long run (I haven't heard of anyone in the scientific community who's tried it---big finance has, but they are not so open).

If the question is what should you learn to get a job in scientific computing, then the first thing I'd say is that you're more likely to get hired for your scientific skills than your programming skills (which partially explains the sorry state of a lot of scientific code, for more on this see this SO topic). If you are going to be hired for your programming skills (probably HPC), then consider that in the opinion of this professor, those may be obsolete for newer projects in the not-so-distant future. It wouldn't hurt to know some Python, though, including NumPy.

Glenn
This is an interesting notion. Not the case in my business just now---much of our big crunching is IO bound or nearly so (lots of looking up data tables and writing results at multiple stages)---but very interesting. Right now we parallelise on a per-input file basis, and run on loosely coupled clusters. My crystal ball is cloudy, so I can't say when that might change.
dmckee
+1  A: 

A lot of "scientific computing" is handled in Mathematica, Matlab and other similar tools.

Well... under the hood, Matlab is written in C or C++, I think, but many parts of Mathematica are written in Mathematica itself. To be sure, for historical reasons, and also because C's intrinsic characteristics, many scientific and hi-tech computing software libraries and such are written in C/C++.

I suspect C/C++ will continue to enjoy a favorable edge for many real-time and high performance applications, maybe not so much for the raw computing itself (which can not be expressed in higher level languages), but for local optimization of tight loops, and for interfacing with various components, be they physical pieces of equipement, or software elements such as for example parallel computing frameworks.

As dmckee pointed out, the study of c provides a good foundation for programming at large, at least procedural programming. It also has practical applications, so your professor's opinion has some strong backing at this time. But, do! continue to challenge, respectfully, the wisdom received from your professors and elders, understanding that sometimes like good zen masters, they put you on a path, not so much for the destination but for the travel/process.

mjv
Well all the linear algebra heavy-lifting in Matlab is delegated to LAPACK, which is built on Fortran. So by using Matlab you implicitly use Fortran compiled code for most of the time-consuming operations.
Tim Lin
+1  A: 

C is widely-used in programming. Most of us programmer ever coding in C especially when we're at college. It's just your professor preference I guess :-)

Ferry Meidianto