Monday, December 26, 2016

The Need of C++

The Need of C++:

1.       If you know C/C++ better, you can easily understand Java, JavaScript, and many other C-style languages.
2.       If you want to find out some implementation detail about operating system, Linux or minix would be the best choice, and they are both written in C/C++.
3.       There are tremendous excellent tools/libraries that are written in C/C++, which you can use to build the basic blocks of your project.
4.       If you want to write programs (Android apps, server side programs, etc.) they are secure and efficient, you should consider using C/C++.

Features of C++:

1.       Function overloading
2.       Inline function
3.       Operator overloading
4.       Easier way of memory management
5.       Run time polymorphism
6.       Stream class library for easier input/output
7.       Exception handling
8.       Run time information

History of C++:

During the late 1970s and early 1980s, C became the dominant computer programming language, and it is still widely used today. Since C is a successful and useful language, you might ask why a need for something else existed. The answer is complexity.  Throughout the history of programming, the increasing complexity of programs has driven the need for better ways to manage that complexity. C++ is response to that need. To better understand why managing program complexity is fundamental to the creation of C++, consider the following.

Approaches to programming have changed dramatically since the invention of the computer. For example, when computers were first invented, programming was done by manually toggling in the binary machine instructions by use of the front panel. As long as programs were just a few hundred instructions long, this approach worked. As programs grew, assembly language was invented so that a programmer could deal with larger, increasingly complex programs by using symbolic representations of the machine instructions. As programs continued to grow, high-level languages were introduced that gave the programmer more tools with which to handle complexity.

The first widespread language was, of course, FORTRAN. While FORTRAN was an impressive first step, it is hardly a language that encourages clear and easy-to understand programs. The 1960s gave birth to structured programming. This is the method of programming championed by languages such as C.

The use of structured languages enabled programmers to write, for the first time, moderately complex programs fairly easily. However, even with structured programming methods, once a project reaches a certain size, its complexity exceeds what a programmer can manage. By the early 1980s, many projects were pushing the structured approach past its limits.

To solve this problem, a new way to program was invented, called object-oriented programming (OOP). Object-oriented programming is discussed in detail later in this book, but here is a brief definition: OOP is a programming methodology that helps organize complex programs through the use of inheritance, encapsulation, and polymorphism.

In the final analysis, although C is one of the world's great programming languages, there is a limit to its ability to handle complexity. Once a program exceeds somewhere between 25,000 and 100,000 lines of code, it becomes so complex that it is difficult to grasp as a totality. C++ allows this barrier to be broken, and helps the programmer comprehend and manage larger programs.

C++ was invented by Bjarne Stroustrup in 1979, while he was working at Bell Laboratories in Murray Hill, New Jersey. Stroustrup initially called the new language "C with Classes."

Use of C++

C++ is used by hundreds of thousands of programmers in essentially every application domain.
C++ is being highly used to write device drivers and other software that rely on direct manipulation of hardware under real-time constraints.
C++ is widely used for teaching and research because it is clean enough for successful teaching of basic concepts.

Anyone who has used either an Apple Macintosh or a PC running Windows has indirectly used C++ because the primary user interfaces of these systems are written in C++.

Click here to download pdf file

No comments:

Post a Comment