What is C++ (programming language)?
“C++ is a statically-typed, free-form, (usually) compiled, multi-paradigm, intermediate-level general-purpose middle-level programming language.”
In simple terms, C++ is a sophisticated, efficient and a general-purpose programming language based on C. It was developed by Bjarne Stroustrup in 1979.
Many of today’s operating systems, system drivers, browsers and games use C++ as their core language. This makes C++ one of the most popular languages today.
Since it is an enhanced/extended version of C programming language, C and C++ are often denoted together as C/C++.
History of C++
While Bjarne Stroustrup was working in AT&T Bell Labs in 1979, he faced difficulties in analyzing UNIX kernel for distributed systems. The current languages were either too slow or too low level. So, he set forward to create a new language.
For building this language, he chose C. Why C? Because it is a general purpose language and is very efficient as well as fast in its operations.
He used his knowledge of object-oriented model from SIMULA and began working on class extensions to C. His aim was to create a language with far higher level of abstraction while retaining the efficiency of C.
This new programming language was named C withClasses, but was later renamed to C++ (++ refers to the increment operator in C).
When C++ was first released in 1985, there were no official standards released. It was only until 1998 that C++ was first standardized which was known as C++98.
In 2003, a new version of C++ standard was published. C++03 wasn’t really a new standard altogether but a bug fix release identified with C++98 “to ensure greater consistency and portability”.
The next major standard for C++ was released in 2011 and it was named C++11. Since, C++ committee was sure this update would be released within 2009, they unofficially named it C++0x. Later, when they didn’t, Stroustrup joked that C++0x went hexadecimal - C++0xB (C++11). Nice save.
C++14 is the current iteration of C++ released in 2014. Like C++03, it included mainly bug fixes and simple improvements to C++11.
The supposedly next iteration to C++ which is planned to be rolled out in 2017. It is expected to have many new features. Most of the features planned for this version are already completed.
Features of C++
Being a general-purpose language, C++ is undoubtedly feature-rich. Going through all the features will take you some time but, as a beginner, below are the most important features you should know.
- C++ is fast
Since, C++ is an extended version of C, the C part of it is very low level.
This offers a huge boost in speed that high level languages like Python, Java don’t give you.
- C++ is statically typed
C++ is a statically typed programming language.
In simple terms, C++ doesn’t allow the compiler to make assumptions about the type of data e.g. 10 is different from “10” and you have to let C++ know which one you are talking about.
This helps the compiler catch errors and bugs before execution of the program.
- C++ is a multi-paradigm programming language
C++ supports at least 7 different styles of programming and gives developers the freedom to choose one at their will.
Unlike Java and Python, you don’t need to use objects to solve every task (if it’s not necessary).
You can choose the programming style that fits your use case.
- Object oriented programming with C++
Object oriented programming helps you solve a complex problem intuitively.
With its use in C++, you are able to divide these complex problems into smaller sets by creating objects.
- Power of standard library (Standard template library - STL)
The power of C++ extends with the use of standard libraries contained in it.
These libraries contain efficient algorithms that you use extensively while coding.
This saves ample amount of programming effort, which otherwise would have been wasted reinventing the wheel.