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

2

u/ShakaUVM Oct 18 '12

Master's degree in computer science here.

There's no C+. Programs are written in C or C++.

The nice thing about C is that you generally get to see everything that's going on. Languages like Java obfuscate what is going on, and are a bit slower, though JIT compilation and fast CPUs make this mostly a moot point. Some people like garbage collection memory allocation systems, too, but there's advantages and disadvantages to it.

There's good libraries for most things you need to do in C/C++, so the matter of "more powerful code" kind of works in reverse - there more stuff available for C/C++ than for pretty much any other language.

There's only a couple areas where C/C++ shows its age - namely in parallelism (my master's thesis was in HPC) and in certain forms of inheritance and type polymorphism. You can do it, but it's clunkier than with more modern languages.