In this lesson we will cover the following:
1. A Brief History of C++
-Connection to C
-Advantages of C++
-Evolution of the C++ Standard
-Who Uses Programs Written in C++?
2. Programming a C++ Application
-Steps to Generating an Executable
-Analyzing Errors and "Debugging"
-Integrated Development Environments
-Programming Your First C++ Application
-Building and Executing Your First C++ Application
-Understanding Compiler Errors
3. What's New in C++?
The purpose of a programming language is to make consumption of computational resources easier. C++ is not a new language, yet one that is popularly adopted and continuously evolving. At the time of this writing, the newest version of C++ ratified by the International Organization for Standardization (ISO) is popularly called C++14, published in December 2014.
Connection to C
Initially developed by Bjarne Stroustroup at Bell Labs in 1979, C++ was designed to be a successor to C. In contrast to C, however, C++ was designed to be an object-oriented programming language that implements concepts such as inheritance, abstraction, polymorphism, and encapsulation. C++ features classes that are used to contain member data and member methods. These member methods operate using member data. The effect of this organization is that the programmer models data and actions he wants to perform using the same. Many popular C++ compilers have continued to support C programming too.
Advantages of C++
C++ is considered an intermediate-level programming language, which means that it allows for high-level programming of applications as well as low-level programming of libraries that work close to the hardware. For many programmers, C++ provides the optimal mix of being a high-level language that lets one develop complex applications while supplying flexibility in allowing the developer to extract the best performance via accurate control of resource consumption and availability. In spite of the presence of newer programming languages such as Java and others based on .NET, C++ has remained relevant and has also evolved. Newer languages provide certain features like memory management via garbage collection implemented in a run-time component that endear them to some programmers. Yet, C++ remains the language of choice for cases where accurate control over their applications resource consumption and performance is needed. A tiered architecture where a web server programmed in C++ serves other components programmed in HTML, Java, or .NET is common.
Evolution of the C++ Standard
Due to its popularity, years of evolution resulted in C++ being accepted and adopted on many different platforms, most using their own C++ compilers. This evolution caused compiler-specific deviations and, therefore, interoperability problems and porting issues. Hence, there emerged a need to standardize the language and provide compiler manufacturers with a standard language specification to work with. In 1998, the first standard version of C++ was ratified by the ISO Committee in ISO/IEC 14882:1998. Since then the standard has undergone ambitious changes that have improved the usability of the language, and have extended the support of the standard library.
Who Uses Programs Written in C++?
The list of applications, operating systems, web services, and database and enterprise software programmed in C++ is a long one. No matter who you are or what you do with a computer, chances are that you already are consuming software programmed in C++. In addition to software engineers, C++ is often a language of choice for research work by physicists and mathematicians.
When you start Notepad on Windows or the Terminal on Linux, you actually are telling the processor to run an executable of that program. The executable is the finished product that can be run and should do what the programmer intended to achieve.
Steps to Generating an Executable
Writing a C++ program is a first step towards creating an executable that can eventually run on your operating system. The basic steps in creating applications in C++ are the following:
Writing (or programming) C++ code using a text editor
Compiling code using a C++ compiler that converts it to a machine language version contained in "object files"
Linking the output of the compiler using a linker to get an executable (.exe in Windows, for example)
Knowledge or experience in C programming is not a prerequisite for learning C++. If your ultimate goal is to learn an object-oriented programming language like C++, then you don't need to start learning a procedural language like C.
The current standard may or may not be immediately or completely supported by all popular compilers. Therefore, while it may be good to know of the newest additions to the standard from an academic point of view, one must remember that these additions are not a prerequisite to writing good, functioning C++ applications.