Java vs C++ vs C – Infrastructure Technology Advantages

cjavalanguage-features

I have been going through interview questions and I saw one which made me stop and think for a while. It starts with a quote and asks about your interpretation and whether you agree or not.

"For infrastructure technology, C will be hard to displace." – Dennis Ritchie

From a bit of background reading you can find that he was the mastermind behind C language as well as the UNIX OS. At the time it was a phenomenal improvement and at the forefront of cutting edge techniques. I feel that C++ and Java are becoming increasingly popular languages, but C will always be an important language.

What do other languages offer when it comes to infrastructure technology that could indicate its advantage over C in the future. On a side note, does anybody know which year this quote was made? I just want the opinions of people who use these languages a lot, I myself use python language and would love to learn a bit more about the framework around C and it's importance firsthand.

Best Answer

For all of its advantages, C is an unsafe language; it lacks many of the safety guarantees that other languages have, such as:

  • Array bounds checking
  • Type safety
  • Garbage collection (to avoid memory leaks)

Despite these disadvantages, C is "closer to the metal," making it a very high-performing language, and offering real-time performance guarantees. This is why it is often used to write kernels and device drivers, where performance really matters.

In reality, the most important part of an operating system (it's "kernel") is quite small; it can be written in C, while most of the other parts of the OS could be written in a more "modern" language.