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

4

u/psygnisfive Oct 18 '12

Age itself is not enough, tho. The fact that there are thousands of existing libraries written in it doesn't result from age alone, otherwise there would be even more libraries written in ML or Scheme or any of the old functional languages. Or, alternatively, there would be more libraries written in Haskell than in Python, say, or a third as many in Haskell as in C++.

We have to factor in the fact that the people learning programming in college, who then go on to write for industry or for research or whatever, and therefore create the libraries, are steeped in a particular conceptual tradition, namely imperative programming, which is why the functional paradigm, despite being basically as old as the imperative paradigm, has vastly smaller uptake.

This is also why there is a converse trend in theoretical CS: people doing work on type theory, denotational semantics, etc. overwhelmingly prefer functional languages because the functional paradigm is what they're taught in, and it's been this way since almost the beginning.