Thursday, 23 May 2013

Brief introduction to C++

C++ (pronounced C plus plus) is an object oriented programming language, and its features are highly interrelated. To give a brief overview of the C++ and its features, this article will highlight the most important aspects in C++.
• History of C++
C++ is the extension to the previous programming version called as C. It was first invented by Bjarne Stroustrup in 1979 at Bell Laboratories in Murray Hill, New Jersey. It was first called as “C with classes”, but later in 1983 it was renamed to C++. In those times, C was the most popular and globally accepted professional programming language; the advent of C++ was because of one major factor – increasing complexity. Even though C is an excellent programming language, problems started to show when programs started becoming more and more complex. C++ allowed programmers to break down code into parts at the same time keeping it together in a logical manner. Thus, allowing larger complex programs to be compressed and faster in execution.

Since its introduction, C++ has undergone 3 major updates, each adding to language. The first was in 1985, followed by the second in 1990 and the third was the standardization of C++ by a joint ANSI (American National Standards Institute) and ISO (International Standards Organization) committee.
• What is Object Oriented Programming?
Since object oriented programming is the key reason for the creation of C++, it is powerful tool which dramatically changed the complete programming methodology. Through the years of development in programming languages, complexity kept on increasing and prior to object oriented programming many projects were at a point where structured programming no longer worked. Object oriented programming integrated the best ideas of structured programming which resulted in a completely new way of organizing a program. In general, a program can be organized in two ways – around the code and around the data. In case of structured programming, programs are organized around the code. But in case of object oriented programming data can define the actions to be performed on related data. All object oriented programming have three concepts in common – encapsulation, polymorphism and inheritance.
• Encapsulation
Encapsulation is the mechanism through which data and code is bound together. It keeps both safe and secure from unauthorized access. When such integration takes place, an object is created, which supports encapsulation. Data within can be either privately accessed by another part of object or publicly accessed which can be accessed by outside members.
• Polymorphism
Object oriented programming supports polymorphism which basically allows an operator or function to be used differently in different contexts. Polymorphism helps reduce complexity by enabling reusability of code, increasing robustness in the application and increased maintainability.
• Inheritance
Inheritance in C++ is the process by which an object can inherit or acquire properties of another object. This important feature of object oriented programming supports the concept of hierarchical classification. Without the use of inheritance, each object’s characteristics would have to be defined separately which leads to flooding of same code. However through inheritance, the unique characteristics can be defined in a base class and the rest be appropriately in inherited classes.


No comments:

Post a Comment