In December, the new C++ standard, C++17 (or, if you prefer, informally, C++lz)
was approved. Lots of new features such as initialization in if
and switch, comma separated arguments in namespace
declarations, inline variables etc were added. But wait, that is not what this
article is about. It is about the relevance of C++ in 2018. So even if you aren't
familiar with the syntax and usage of C++, this article will still prove to be a
Now a days, many new programming languages are coming out. The question is,
in today's world, where relatively new languages, such as Haskell, Rust, Swift etc
are in vogue, is C++ still relevant? Moreover, the Standards committee is
making the syntax rules more and more complex with every new release which
makes learning the language very difficult.
There is no straight forward answer to this question. Many of the applications
and services we use today extensively use C++. For example, most of the back-
end in Facebook involves C++, Google's file system is written in C++, most of
Adobe's applications, including Photoshop, Illustrator and Premier are written in
C++. In other words, half of the applications we tend to use everyday, either
directly or indirectly, use C++.
Let's take a quick look at the pros of using C++. The three major features of
C++ are Object Oriented Design, Generic programming and the usual
procedural features. The OOP and Generic programming philosophies are
perhaps what make it stand out from a regular functional programming
language, such as C. Then the obvious question arises. What makes it better than
a language such as, say, Python? The answer is simple. Efficiency. Both memory
and time wise, C++ is far more efficient than languages like Python or Haskell.
C++ lays emphasis on high level abstraction and reusability of code through
polymorphism and inheritance. It also has backward compatibility, meaning any
valid C program is a valid C++ program. C++ has a lot of support for portability.
Therefore, most of the programs developed in C++ are platform independent.
Now, having so many advantages does not imply that it has no disadvantages. In
fact, it has a few, but very subtle and insidious loop holes. For example
(((unsigned int)0-1)>0) returns true. But that is
a defect it has inherited from C and not something that is exclusive to C++. This
might seem obvious to an experienced C/C++ programmer, but to a new comer it
doesn’t make sense.
Let's try to focus on the disadvantages which are a little less-geeky.
It has no security. This is probably the biggest disadvantage with C++. Most of
the loop holes in security arise due to "features" like friends, global variables and
As the complexity of the application increases, the code to be written in C++
also increases which results in the obvious difficulty of maintaining the code in
the long run.
Debugging a program written in C++ is an invitation to disaster. A well known
warning like comment is along the lines "You
think you know what you're doing, but believe me, you don't."
Hence C+++, like any other language/tool/framework, comes with its own set of
advantages and disadvantages. So answering the original question, is C++ still
relevant in 2018? Yes, it is. In fact I think, it will still be in use for the next 10
years, before it becomes completely obsolete, due to its widespread nature.
In the end, it all boils down to personal preferences and tastes. After all, a
programming language is just a tool to achieve the task at hand. This probably
applies to other aspects of life too. So we must learn to respect others' choices
and preferences while maintaining our own.
As someone once said, “We should look for elegance in the application built,
rather than in languages themselves.”