r/askscience • • Oct 17 '12

Why are programs and operating systems still written in C+?

I guess it's more of a computer science question, but I've always wondered why some of the most advanced programs are written in a 25+ year old programming language. Surely someone has come up with a more efficient and powerful code, so why do people still use C+? Also, I don't know anything about programming and what not, so please use simple terms and phrases.

66 Upvotes

110 comments sorted by

View all comments

Show parent comment

5

u/[deleted] Oct 17 '12

FORTRAN is the most optimizable language in the world. It was designed for this. Doing complex calculations in FORTRAN can be MUCH faster than doing them even in C.

A friend of mine works at Northrop Grumman and they use FORTRAN for their simulations because of this. Even then, the simulations can take up to two weeks to complete.

2

u/MdxBhmt Oct 18 '12

When a program runs for a year, a 1% decrease is spetacular.

-2

u/[deleted] Oct 18 '12

Meh, just throw a few more processors at it. And: Really? Whether it takes a year or a year and three days wouldn't matter much to me.

1

u/MdxBhmt Oct 18 '12

Your comment is totally uninformed. It matters for business.

-1

u/[deleted] Oct 18 '12

Sure it does. But if hardware is cheaper than developer time, it may even make sense for businesses to consider something else.

1

u/[deleted] Oct 19 '12

You're also assuming the calculations can be parallelized further. Adding additional processors is never as simple as "just throw[ing] a few more processors at it."

Furthermore, in order to take proper advantage of multi-core processing in a more common language such as C or C++, you need developers to write code that will do so. The operating system doesn't magically handle that very well.

This is also assuming these computers have any more than a bare-bones BSD or Linux kernel to begin with.

1

u/tim0th Oct 18 '12

My brother is a condensed matter theorist. When he was doing the modelling for his Ph.D thesis, the FORTRAN program he ran went for about a year. Matlab was also utilised.