I've been asked many times by my juniors about the areas in which C++ is widely used. I usually answer Operating Systems. Are there any other areas where its extensively used?
Numerical computations: physics, graphical games, finance, statistics;
Bit fiddling: drivers, operating systems, networking, embedded devices;
Anywhere you need exact control of allocation of memory.
it's used where you find it solve your problems efficiency. Compilers, writing Drivers ...
In legacy code...
Even Stroustrup admits C++ has many mistakes, most inherited from C. That is why C++0x is being developed.
I wouldn't say Operating Systems actually. The Linux & Windows kernels are mostly C, with only userland stuff being C++ (granted, drivers could be written in anything). I'm not sure about Mach (OS X), but I wouldn't be surprised if it were mostly C as well.
C++ filled this wonderful nitch of "Object Oriented, but fast enough for dinky computers in the late-80s & early-90s". Accordingly, anything written in the 90s had a good chance of being written in C++; applications, drivers, games, whatever.
Today, new development seems to be done mostly in managed (JVM/.NET) languages. Not that there isn't any new C++ development; games, in particular, are still performance limited enough to use C++ in many cases.
In short:
- Drivers
- Games
- LEGACY CODE
Currently it is in game development and performance critical applications. However, there is lots of older stuff written in C++ which was mostly written before Java and .NET were introduced, and this code still needs to be maintained.
A quite large and probably quite definitive list of software written in C++ can be found at Bjarne Stroustrup's homepage.
- Several major operating systems have been written in c++
- Uncompromising low-level efficiency essential for C++. This allows us to use C++ to write device drivers
- Much numerical, scientific, and engineering computation is done in C++.
- Graphics and user interfaces are areas in which C++ is heavily used.
- C++ is widely used for teaching and research
- Games
C++ is also used heavily in real-time financial market data software. Latency here is very important. C++ is great choice since it's almost the closest to metal.
C++ in Operating Systems: No kernels (the core bit that really does all the nasty work like memory management and drivers ) that I know of are written in C++, just C. Linux is written in C and so is Windows.
See here: http://stackoverflow.com/questions/580292/what-languages-are-windows-mac-os-x-and-linux-written-in
Applications ( non-kernel bits that make up an OS ) these days are written in whatever language seems best for the job.
You would choose C++ if the following were important to you:
- You want to make heavy use of classes and inheritence
- You only plan on working on one OS
- You want reasonable performance
- Your developers already know C++
- You want to divide work on similar components to different people or teams ( you can give each time a class or interface to implement )
You can do all of the above with C, portability between platforms is still an issue ( C++ is equally platform specific as most C ) In C you have to be more strict make good use of static and dynamic analysis tools. It's easier to leak memory in C than in C++ too.
Consider this: From the introduction of MFC until the introduction of the .NET framework, C++ was the preferred language for Windows development. So that should tell you something. Preferred by Microsoft that is, many developers still prefer it to .Net languages.
C++ is a language capable of systems level programming, but also due to the provision of extensive libraries it is used for applications programming also. I would guess that almost every application running on your Desktop PC was written in C++.
If you can get a library for anything, you can almost certainly get it for C++.
It is widely used in the games industry, and to some extent in the embedded systems domain.
So I would say - 'everywhere'. It is after all a 'general purpose' programming language.
C++ and C are used heavily in embedded systems since one can have deterministic control of memory and other scarce resources. I think most games (well at least the games I play) are still written in C++, probably because there exists large frameworks written in C++ which have been fully tested and are very capable.
I have seen C++ used quite heavily in GUIs, due to the object orientated nature being sort of natural for "widgets".
I once saw it used in safety-critical code for an aircraft. This still gives me nightmares.
Any application based on Qt will use it as Qt is written in C++.
Also, since KDE is based on Qt pretty much the whole desktop environment including the applications designed to work within it are therefore written in C++.
Around Basingstoke apparently.
(unemployed C++ guy in Glasgow)