C is the best language (or maybe the single language) suitable for operating systems, drivers, embedded systems etc. For more complex domains like computer graphics C++ is a better choice. But these applications have thorough performance requirements and they are only feasible to be built in C/C++.

Now the question is, if the performance requirements can be achieved in another language, are there any technical reasons to choose C/C++?

closed as not constructive by Robert Harvey, Justin Cave, Tyanna, user7007, Charles Salvia Feb 9 '13 at 2:45

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    I don't see how this is answerable. I don't consider it self-evident that some applications can only be written in C or C++, and you're basically asking for a list of all the other reasons someone might choose a language besides performance. – Robert Harvey Feb 8 '13 at 23:57
  • 1
    "Performance requirements" is not the only reason C is used for operating systems. – user16764 Feb 8 '13 at 23:59
  • @Robert Harvey Are there any used OS (kernel) or system drivers written in anything else than C or C++? Anyway, that's not the point; we both no that these languages represent a de facto choice for those types of applications. And yes, that's what I'm asking; does C/C++ fill in other reasons, different from performance? – m3th0dman Feb 9 '13 at 0:04
  • Its not performance its predictability in timing and execution. Java can perform just as well but its determinism in timing of code is poor. – Andrew T Finnell Feb 9 '13 at 14:21
  • @Andrew Finnell It is performance mostly; Java can achieve predictability with VMs that implement the real-time specification. – m3th0dman Feb 9 '13 at 15:26

Yes. Almost every single language under the sun can link to C; by using C you're ensuring that someone can come along with whatever language they like and successfully link to your API.


Yes. Portability.

Famously, the reason Unix was written in C was for portability across the systems of the time.

Today, A C++ Qt application is still easier package for multiple platforms (even if they're just Windows, Linux and Mac) than an equivalent PyQt application.

  • Ignoring desktop UI, isn't Java more suitable for portability? – m3th0dman Feb 9 '13 at 0:53
  • @m3th0dman If you want to ignore desktop UIs, what kind of applications are you actually thinking of? You didn't specify anything in your question. – us2012 Feb 9 '13 at 1:26

Of course, there are many.

Just a few of the reasons include:

  • code size (some of us work in the embedded world without gigabytes of RAM)
  • programmer proficiency / competence
  • tool / platform support
  • legacy code considerations (e.g. older code written in C or C++)

I could go on & on. If I take your question literally, it's basically, "What other criteria other than performance could ever matter when choosing a programming language?"

Not the answer you're looking for? Browse other questions tagged or ask your own question.