Why Should You Learn C++?

Lightning McQueen isn’t out of tricks just yet

Kell
The Startup
4 min readMar 30, 2020

--

C++ can change a lot for the better | Photo by StackCommerce

Foreword

With so many choices in programming languages nowadays, it seems like people seem to forget about one of the progenitors for modern programming practices: C++. This story is going to cover why, in my opinion, you should learn C++ in 2020, when there are so many other options available.

Programming in a Modern Context

Modern programming has, for whatever reason, become less about speed than it is about speed or quality. Developers tend to prefer languages that are easy to use to create application components like user interfaces and, as a result, are able to push their products to production a lot quicker, but it comes at the cost of speed. One of the most popular languages recently is JavaScript, and it’s heavy use in the area of interface development is telling because it shows that developers are more concerned with being able to work quickly than in a quality-focused fashion.

This approach to development causes two problems: firstly, interfaces tend to have a lot more bugs that make it into the finished product and secondly, the finished product tends to be of a lesser quality, overall. It’s a nasty feedback loop that just makes its own problem worse and worse with time, and that’s why I truly believe that U.I. programming is best done in a lower-level language like C++, so that the developer has more control over the software’s interactions and so that every little thing in the application is well-defined and controlled in such a clean manner.

Low-Level Virtual Machine

The low-level virtual machine, or LLVM, is a “collection of compiler or toolchain technologies.” What exactly does that mean? Well, for starters, it means that we’re not stuck with GCC when we need to compile a program, which enforces a GNU GPL license. But what, exactly, makes LLVM worth mentioning in a story meant to persuade you to learn C++ in the age of JavaScript?

Clang.

Clang is a C/C++ compiler frontend for LLVM. It’s feature-set is extensive and is fully cross-platform, which is what makes it generally preferable to GCC, as the latter tends to mostly stick to *nix platforms like Linux or macOS, and doesn’t normally play well with the Win32 platform without a compatibility layer such as MinGW or Cygwin (and, more recently, the WSL).

Besides having better cross-platform support, LLVM also provides a much better debugging experience than that of GCC and, if you give it a short trial run, you’ll see what I mean.

These aren’t the only reasons to use LLVM, but they are important ones. Now, let’s look at additions to the language and discuss what they provide and take away from the context of a healthy programming language.

Language Additions

The C++ language has a set of standards that are set by the International Organization for Standardization (ISO). These standards are introduced every three years, according to a release cadence specified in 2011, and each release adds more and more to the language.

This, from a beginner’s perspective, can be very confusing, as C++ is already quite the mixed bag of features, and with more and more added every few years, it may only seem to get worse. But, in my opinion, this can be a good thing. The language provides an extensive set of features, which meet the needs of a discerning community of developers. For example, a feature called concepts was added with C++20 that expands on what templates initially sought out to do, which was to enable the support for generic programming practices.

Additions to the language sit at the core of what C++ is all about. The language provides a layer of abstraction on top of bare-metal and it also provides the programming which the option to utilize more abstract functions of the language which provide additional features, sometimes at the cost of performance.

Precision of Language

In the C++ language, the programmer has to manually take care of memory management and has to specify every part of a program meticulously. This is the reason that C++ is so heavily used in game development: it’s fast because it works precisely with the hardware of the computer.

A prime example of the beauty of this particular aspect of the language can be shown in pointers. They are used to “point to” addresses in a computer’s memory and, when used well, make a program wildly efficient, but can also pose problems when they become subject to human error. Smart pointers, however, seek to eliminate this problem, for a large part by providing a safer wrapper around raw pointers and references.

Honestly, I believe that this precision is the single biggest reason to learn C++ in place of a language like JavaScript or even C# — it’s explicit, it’s efficient, and it is fluid.

Conclusion

As said above, I believe that the precision of C++ is the biggest reason to learn the language, if you haven’t already, or to continue using it if you’ve already learned it. The speed and fluidity of C++ are simply too difficult to ignore.

Resources

--

--