Introduction to C++ Programming Language

Introduction to C++ Programming Language


What is Programming?

Computer doesn't know our language directly. Computer programming is a medium for us to communicate with computers. Just like we use bengali or english to communicate with each other, programming is a way for us to deliver our instructions too the computer.
In short the medium through which computer can understand us is called programming language.


What is C++ Language ?

C++ is an object-oriented versatile programming language, was developed by Bjarne Stroustrup at AT&T Bell Laboratories in New Jersey, USA, in the early 1980's. The C++ is an extension of C with a major addition of the class construct feature of Simula67 programming language. The most important facilities that C++ adds on to C are classes, inheritance, function overloading and operator overloading.

History of C++ :

~ The C++ programming language was created by Bjarne Stroustrup and his team at AT&T Bell Laboratories in Murray Hill, New Jersey, USA, to help implement simulation projects in an object-oriented and efficient way, in the early 1980's.

~ Bjarne was an admirer of Simula67 and a strong supporter of C Programming Language. He wanted to combine the best of both the languages and create a more powerful language that could support object-oriented programming features and still retain the power and elegance of C. And so he created the Cpp (C Plus Plus) or C++ programming Language.

~ Since the class was a major addition to the original C language, he named the new language "C with Classes". However in 1983, the name was changed to "C++". C++ was derived from the C programming language: ++ is the increment operator in C.

~ As early as 1989 an ANSI Committee (American National Standards Institute) was founded to standardize the C++ programming language. The aim was to have as many compiler vendors and software developers as possible agree on a unified description of the language in order to avoid the confusion caused by a variety of dialects.

    In 1998 the ISO (International Organization for Standardization) approved a standard for C++ (ISO/IEC 14882).

Why Should We choose C++ over C ?

The C++ is a versatile language for handling very large programs. It is suitable for any programming task including development of editors, compilers, communication system, databases, and any real life application systems. Here are some reasons why should we learn the Cpp language : 

1. Simple & Fast :
C++ can be broken down into logical units and parts and has a rich library support with a variety of data-types. This is why C++ is so simple. As C++ is an extended version of C it is one of the fastest languages till now offering better features as well.

2. Object-Oriented :
C++ is an object-oriented programming language which makes it one of the strongest points of the language. Object-Oriented support helps C++ to make maintainable and extensible programs means that large and complex problems must be divided into small chunks.

3. Rich library support :
C++ has a rich library support including both "Standard Built-in data structures, algorithm etc" as well third-party libraries like "Boost libraries" for the fast and rapid development. This rich library saves a lot of time which might be wasted while programming.

4. Multi-paradigm language :
The C++ is a multiparadigm programming language which supports more than 7 different styles of programming and allows developers to choose their own preferred taste.

5. Mid-level language : 
It is a mid-level language as it can do both systems-programming (drivers, kernels, networking etc.). It can also build large-scale user applications (Media Players, Photoshop, Game Engines etc.)

6. Exception Handling :
Comparing to C, error/exception handling makes the C++ language even superior.

7. Better Macro :
In C, we use Macros and in C++ we use Inline Functions, which makes the entire function body act like a Macro.

Applications of Cpp :

C++ is not a purely object-oriented language but a hybrid that contains the functionality of the C programming language. This means Cpp has all the features that are available in C :

1. Cpp has all the features of any object-oriented language – Object, Class, Encapsulation, Inheritance, Polymorphism, Dynamic Binding, and Message Passing.
2. Cpp is used to create Graphical User Interface which simplifies the user’s interaction with an application. Adobe Systems, Windows Media Player, and Blender being a few of them.
3. Cpp is also used to create web browsers like Mozilla Firefox and compilers.
4. The operating systems like Windows, Linux are also programmed in Cpp.
5. Cpp is used for the development of all kind of technical and commercial software.
6. Despite being an extension of C, Few of the other programming languages like C#, Java, JavaScript, PHP, Python are built using the Cpp Language.
7. Cpp helps developing gaming engines as it is faster and gives better control over hardware.
8. In the world of Database Management, engines like MySQL, Postgres, and MongoDB were written in Cpp.


Let's start with a C++ programming :
#include<iostream>  //Header file
using namespace std;  //This defines a scope for the identifiers that are used in the program.
int main()  
{ 
cout << "Welcome to Eruditors" << endl << "Enjoy yourself with C++"; //Printing C++ statement using "cout <<" and endl for newline. 
return 0; 
}

/*You can still use printf() for displaying an output as C++ accepts this notation.
However, we will use the cout<< to maintain the spirit of C++.*/


Output :
Welcome to Eruditors                                                 
Enjoy yourself with C++ !!

Advantages of C++ :

1. The C++ is the fastest and most efficient language.
2. Learning C++ gives a good knowledge and makes it easier to learn other programming languages.
3. C++ has a variety of usage and hence learning the language makes it easier to grasp the Object Oriented Programming Concept which is very important for the IT industry.

Disadvantages of C++ :

1. Mastering the C++ language can be a little bit harder.
2. Accessing the libraries can be difficult.
3. The error massages can be extended and is often difficult to correct the error.