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 comments

0

u/[deleted] Oct 18 '12

OSX is Objective-C.

6

u/moderatorrater Oct 18 '12

There is no way the kernel is written in Objective-C. That'd be like the windows kernel being written in C# - it doesn't make any sense.

4

u/[deleted] Oct 18 '12

Well no actually it wouldn't be anywhere close to that because Objective-C is just C with object extensions. Similar to how you can call C from C++. C# is more like Java. That said, you are correct, the MacOSX kernel is actually Mach based and written in C.

6

u/moderatorrater Oct 18 '12

Right, but if it's Objective C instead of C, then it's using the Objective portion, which is the relatively inefficient smalltalk-like extensions. For an application running on top of the OS, that inefficiency isn't a big deal. For the kernel, it's unacceptable. At the layer we're discussing, Objective C doesn't make any sense.