0

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++?

5
  • 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. Commented Feb 8, 2013 at 23:57
  • 1
    "Performance requirements" is not the only reason C is used for operating systems. Commented Feb 8, 2013 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? Commented Feb 9, 2013 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. Commented Feb 9, 2013 at 14:21
  • @Andrew Finnell It is performance mostly; Java can achieve predictability with VMs that implement the real-time specification. Commented Feb 9, 2013 at 15:26

3 Answers 3

2

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.

1

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.

2
  • Ignoring desktop UI, isn't Java more suitable for portability? Commented Feb 9, 2013 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. Commented Feb 9, 2013 at 1:26
1

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?"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.