It will certainly be moral to say that object oriented programming acts as the seventh heaven for the programmers. Till 1970s, object orientation was just thinking among programmers. But using the object oriented approach in C++ is just incredible. The prospect to accustom programming to objects allows the programmer to design various applications and to reuse the code in a more logical and creative manner.
Object-oriented approach reveals a particular way of viewing about problems and tasks in terms of recognizing and describing the behavior of the applicable objects. Smalltalk is a classical example of a pure object-oriented language.
C++ incorporates the facilities for both the object-oriented programming and conventional procedural programming, C++ adjoins many enhancements of its own to fresh up the problems that were present in the original C language.
Structured programming can be roughly divided into two categories:
Structured programming is basically dividing a program into smaller modules that are easier to manage. All of what we have covered up to this point is part of procedural programming. In this the programmer will divide the program into smaller functions rather than putting the entire code within one function.
Each function would have its own variables and sharing of variables between various functions is also possible. When we will see henceforth is related to object oriented programming OOP. Large programs were difficult to handle in procedural programming and OOP was developed to reduce complexity of software development, In C++,OOP is implemented using classes. The main concepts in OOP are:
- Data Abstraction
- Data Encapsulation
HISTORY OF C++
In 1960s different languages were used for different applications, for example, FORTRAN for Engineering Applications, COBOL for Commercial Applications and so on. Later on an international committee was set up that developed a single language called ALGOL 60, which can be used for all applications. But this language was too abstract and too general to be accepted. This lead to the development of a new language named CPL (Combined Programming Language), which had so many features and was hard to learn and implemented.
After this Martin Richards BCPL (Basic Combined Programming Language) and Ken Thompson’s B language were also not accepted because they were too specific to be implemented. Finally, in 1972, Ritchie made a successful attempt at AT & T’s Bell Laboratories of USA to develop a new language called C language by inheriting the features of both the BCPL and B language. In order to define the C language, a committee was set up to create an ANSI American National Standards Institute standard called ANSI C standard, which was finally adopted by ISO International Standard Organization in 1989.
Bjarne Stroustrup at Bell Labs initially developed C++ during the early 1980’s. It was designed to support the features of C such as efficiency and low-level support for system level coding. Added to this were features such as classes with inheritance and virtual functions, C++ is best described as a superset of C, with full support for object-oriented programming. Though C is an excellent language for writing efficient system programs, But for other types of programs, C code can be hard to understand. C programs can also be prone to certain types of error. The extra object-oriented facilities in C++ are partly included to overcome these shortcomings.
Why C++ ?
At first instance a question arises in the mind of a programmer – why should we use C++ in order to develop our applications? Then again a question strikes – what is so special about C++? At this juncture, we are illuminating some important features of C++. After going through these features, we will be in a state to respond to the above queries:
- C++ is a compiled computer language: The original source code The program written by programmer is translated into a machine code The language which computer can understand, all at once, by the computer A compiler is a very specialized computer program that translates source code into machine-specific code.
- C++ permits for abstract idea: C++ allows a programmer to express their ideas at a high level as compared to assembly language.
- C is a subset of C++: Most of C is a subset of C++, so that most C programs can be compiled i.e. converted into a series of low-level instructions that the computer can execute directly using a C++ compiler.
- C++ allows a low-level control to programmer: Although C++ is a third generation language, yet it has some feel of an assembly language. It allows a programmer to work in a low-level environment and make necessary changes as desired.
- C++ is worldwide accepted: C++ is a very widely used programming language. The code written in C++ is in accordance with the national standards ANSI. It can be easily integrated with already existing different code. This facilitate the programmers to reuse various common libraries, so that certain common functions do not need to be written again and again, and these functions behave i a similar manner wherever they are being used.
- C++ is reusable and object-oriented: C++ is an object-oriented language. This feature makes the programming much easier to learn and allows easy reuse of code, or parts of code through by means of inheritance.
- C++ introduces innovative concepts: C++ provides tremendously new concepts like encapsulation, inheritance, virtual functions, classes, overloading, friend functions etc. that has made this particular language far superior than others.
- C++ is a solution to many problems: C++ acts as a key many problems. Introduction of object oriented programming in C++ is a reaction to programming problems that were first seen in large programs being developed in the 70s.
- C++ is easy to maintain and upgrade: C++ realizes the concept of data abstraction in a sparking manner. Data abstraction basically combines the data with the functions used to manipulate the data so that implementation details are hidden from the programmer makes the programs much easier to maintain and upgrade.
- C++ program is easy to modify: C++ has introduced the concepts of inheritance and polymorphism to make the existing code of a program easily modifiable without actually changing the code of a program.
- C++is portable: It is feasible to compile the same C++ code in almost any type of computer and operating system without making changes. C++ can easily be ported to different platforms of programming language.
POINT OF DIVERSION BETWEEN C AND C++
- C++ is an object oriented programming language whereas C is a procedure oriented language.
- Data abstraction can be implemented using C++ which is a way of combining data with the functions used to manipulate the data so that implementation details are hidden from the programmer.
- C++ is the implementation of the real world objects while C concentrates on algorithmic approach.
- C++ makes parts of programs easily reusable and extensible.
- C++ uses bottom up approach i the design of the program. On the other hand C uses top down approach.
- Inheritance and polymorphism can be implemented using C++ whereas these features are not supported by C++.
- C++ provides capability of operator overloading.
- In true programming terms, each and every statement in C is universally implemented in C++ but the reverse is not true.
Here is the list of top C++ Books which you can start to read in year 2021:
Author– Josh Lospinoso
Published Date– 24 September 2019
Author– Stanley Lippman, Josée Lajoie and Barbara Moo
Published Date– 16 August 2012
Author– Bartlomiej Filipek
Published Date– 18 July 2019
Author– V. Anton Spraul
Published Date– 12 August 2012
Author– Bjarne Stroustrup
Published Date– 29 May 2014
Author– Josh Lospinoso Björn Andrist and Viktor Sehr
Published Date– 31 January 2018