The Bedrock of the Software World: C++ Programming Language

January 23 2017
 

Take a closer look at C++ programming language, the advantages over other languages, and why application performance management is critical when using C++


C++ is one of the most popular programming languages in the world. It’s very fast and used for many high-profile projects, including Google Chrome and Microsoft Office. C++ is a mid-level language that communicates close to the hardware layer while still being easier to program than low-level assembly languages. It offers a unique blend of ease of coding and high-speed hardware control. Let’s take a closer look at C++, how it originated, who uses it, and its advantages over other languages.

The Origins and History of C++

In 1972, Dennis Ritchie of Bell Labs created a language for Unix called C. By the late 1970s, C had become popular for developing operating systems. A number of variations on the original language were developed. In the late 1980s, ANSI Standard C was created.

In 1979, Denmark’s Bjarne Stroustrup modified C by adding classes. He made further refinements by implementing object-oriented features to create C++. He was trying to create a language like Scala, so it would be easy to program large software systems but also fast with low-level hardware control like BCPL. C++ gave him more advanced features than C offered while retaining its flexibility and efficiency. By the 1990s, C++ continued to grow and develop and it was often the first choice for operating systems like Windows, BeOS Haiku, and Syllable. It’s ideal for low-level development, robotic spacecraft, and telephone exchanges.

C++ is a language, development environment, and library in one, used for both object-oriented and procedural programming. It can be modified and extended depending on the goals of the programmer, and there are a number of versions of C++ today. They include Microsoft C++ (Microsoft Visual C++ 6.0); ANSI C++; C++ versions from companies such as Turbo, Symantec, Borland, and others; and platform-specific versions.

C++ uses standards written by an ISO standard committee. C++ is not an implementation itself, but has many variations developed by different organizations and companies. Some variations are open-source depending on the goals and guidelines of the originator — for example, both Clang and GNU are open-source implementations of C++.

The Advantages of C++

C++ is sometimes referred to as a “multi-paradigm” language because it can be used for procedural, object-oriented, or functional programming. It is known for its flexibility and extensibility. In a procedural language, modules communicate by writing and reading state located in shared data stores. It is loosely bound with very little shared code.

With a tightly bound object-oriented language, objects communicate by sending various messages to other objects. Object-oriented programming uses encapsulation, with both code and data acting as objects. It simplifies code using polymorphism, the process of deploying one interface and several entities. C++ code runs faster than most other languages. It is highly portable and is a popular choice for creating multi-platform, multi-device applications. It has a useful function library, allows function overloading and exception handling, and includes classes, data abstraction, polymorphism, encapsulation, and inheritance.

Used in a Variety of Fields

C++ is deployed for tasks that demand high performance, such as video editing and transcoding, high-end computer-aided design (CAD), image processing, games, telecommunications, and business. It is used by companies such as Reuters and Bloomberg for data feeds with low latency, by the military for onboard systems, by Google for Chrome and other apps, and by Microsoft for the Office Suite.

Major airlines use flight control systems written in C++. It is popular for game development — the Torque 3-D game engine, written in C++, is used to develop Xbox and iPhone games. Advanced medical equipment makers use C++, and defense contractors use it for mission-specific software APIs. Well-known tech companies and organizations using C++ include Evernote, LinkedIn, Microsoft, Opera, NASA, and Facebook. Evernote switched from .NET to C++ for more speed and better graphics. LinkedIn uses restclient-cpp, a client written in C++ used for making HTTP/REST requests. Facebook uses it for back end services and regularly modifies C++ standards for custom features.

In addition, Wall Street and the financial industry have long used C++ for trading high volumes at high-frequency levels — they like that it can be easily used for modeling and data simulations. Its popularity in finance can be partly attributed to the fact that it is a major investment to adapt to new technologies and C++ simplifies the digital transformation of creating applications that run on legacy systems. More importantly, more than 70 percent of trading is known as High Frequency Trading (HFT), where software programs can trade tens of thousands of transactions in mere seconds. C++ is favored over other languages in HFT environments because on Wall Street, speed equals millions of dollars of revenue and profits.

C++ vs. Other Languages

Programming languages offer different advantages depending on the goals of the project. At Google, for example, C++, Java, and Python dominate. Here’s how they compare:

  • Java: C++ compiles to bytecode at the system level, while Java compiles to Java Virtual Machine bytecode. As a result, there are many cross-platform libraries associated with C++ because different platforms have different compilers. Because Java Virtual Machine is essentially an abstraction layer, Java programs can be run on any device that supports Java. Java is memory safe, but C++ is not. Java has a disciplined system for detecting errors, whereas C++ has unchecked casts and relies on the developer for memory management. Java is a complete object-oriented language, while C++ only utilizes certain OOP elements. Java uses interfaces to provide multiplicity — C++ offers multiple class inheritance.

  • Python: Python differs from C++ in that C++ is a compiled language, while Python is a scripting language. Python’s types are much simpler, and it has a distinct lack of declarations. Types in C++ are bound to names, explicitly declared, and checked when compiled. C++ is a mid-level language that offers lots of power and subsequent complexity. Python is simple to code and understand, which leads to quicker development and easier troubleshooting.

Garbage collection was originally intended to be included in C++, but there were too many technical problems to integrate properly with the rest of the code. However, the lack of garbage collection is an example of the power C++ gives you to customize the language for your purposes — you can easily add garbage collections with smart pointers. Unlike some other programming languages that have garbage collection built in, C++ was developed with speed and efficient infrastructure as its primary goals. It offers many advantages over other languages, with the caveat that you must have a working understanding of low-level programming to get the most out of it.

Is C++ a Good Investment for the Future?

C++ remains a solid investment for the future because of its power, versatility, flexibility, and prevalence in a number of industry verticals. It is still one of the most popular languages for game development, and is a favorite of the scientific community and financial industry. Further, it is often used for creating device drivers, software-defined networking, operating systems, and embedded software.

Handling the Back End at Google

Back end software operates on servers in the data center. C++ is often used for back end computing because it is ideal for heavy number crunching. It is fast, reliable, and compact. It also uses fewer resources per transaction, which is critical when you’re processing thousands of requests at the same time. For instance, Google web applications generally use JavaScript for the browser and Java for servers on the front end, while back end services and data repositories use C++. Google’s back end repository uses BigTable, and it uses MapReduce to handle large amounts of data processing.

The Go-to Language on Wall Street

Part of the reason that C++ is popular on Wall Street, and for quantitative finance in general, is due to its historical presence in the industry. Many developers in the finance industry “grew up” on C++ in the early part of their careers, so it became ubiquitous. Many financial programmers are able to develop in C++, and there’s a plethora of resources and communities to support it. Further, there are extensive math and quantitative-oriented libraries available.

Beyond that, it offers superior performance compared to other solutions such as Java or .NET. In addition, popular C++ libraries such as Boost have made C++ simpler and faster. Also, C++ templates potentially make code easier to optimize than Java or C. There are useful packages such as Rcpp, which adds R functions to C++, and RInside, which adds the R interpreter using a C++ wrapper class.

A Favorite of Game Developers

For a long time, C++ was the only choice for creating high-performance programs such as games. As a result, it’s become a standard solution, with lots of investment in game engines and libraries.

Game developers like C++ because it provides lots of control over hardware. It offers a powerful blend of high-level ease of use, high speed, and low-level hardware access. It is highly deterministic, a quality that is not always true for languages that operate in virtual machines or garbage-collected languages. Many games used to be written in Assembler, because you needed to access the hardware directly to get the best performance. With today’s computers, C++ makes code development faster while still allowing plenty of control over the machine layer.

Monitor Performance

With a powerful language like C++, application performance management is critical. AppDynamics offers C/C++ application performance monitoring that identifies and resolves performance problems in dynamic and distributed environments. The SDK discovers application topology, allowing you to trace transactions from application behavior. It correlates your C++ and C apps with programs written in other languages such as PHP, Node.js, and Python, and it lets you monitor databases, web services, and other back-end functions.

C++ is a fast, reliable, powerful language with few peers in game development, quantitative finance, banking, military and defense, back end systems, and many other applications. It offers a unique blend of hardware control while still being easy to program. Because of these advantages, the future is bright for C++ as it continues to adapt and improve in today’s modern computing environment.

Learn More

Learn more about our C++ performance monitoring solution today.

Omed Habib
Omed Habib is a Director of Product Marketing at AppDynamics. He originally joined AppDynamics as a Principal Product Manager to lead the development of their world-class PHP, Node.js and Python APM agents. An engineer at heart, Omed fell in love with web-scale architecture while directing technology throughout his career. He spends his time exploring new ways to help some of the largest software deployments in the world meet their performance needs.

Thank you! Your submission has been received!

Oops! Something went wrong while submitting the form