Monday, May 12, 2008

Introduction to C++

Welcome to our very first lesson in C++ programming. This introductory lesson will give you some historical background and also the important differences between C++ and its predecessor C.

The C++ programming language can be thought of as the traditional C progamming language with an important added feature; classes. Classes is a significant feature of a very popular and indeed powerful programming technique called object-oriented programming (OOP). Well, let's have a look at the C programming language.

The C programming language was developed by Dennis Rithcie of AT&T Bell Laboratories in 1972. It was designed for writing and maintaining UNIX operating system. Before C, UNIX system programmers wrote their programs in assembly (a low-level language) or a in language called B. Today B is almost extinct, as it was replaced by C. C is a very powerful and fast language. It is also considered a general-purpose language, as it can be used to write any sort of program. C and UNIX fit very well together, actually so well that almost all commercial programs that ran under UNIX were written in the C language. It simply rocked the programming world, but C was not perfect.

The C progamming language is a high-level language, with many features of a low-level language. Like low-level assembly you have directly access to the computer memory, so memory manipulation is easy. In its written style it is a high-level language, which makes it more easy to read and write (compared to assembly). This way, it was a very good and fast language for writing system programs and system applications. But for many other programming tasks, it was not so easy to understand and come around. In addition to this, it didn't have the automatic checks as some other high-level languages. This made errors much harder to spot.

Bjarne Stroustrup, the developer of C++
Bjarne Stroustrup, the developer of C++

This is partly why C++ was born. The C++ programming language was also developed at AT&T Bell Laboratories (by Bjarne Stroustrup), seven years after C (that is 1979). It was first named "C with classes", but in 1983 it was renamed to C++, as there were made more enhancements. These further enhancements were mainly virtual functions, operator overloading, multiple inheritance, templates and exception handling. Note: C++ being an enhancement of C, means that most C programs also are C++ programs (the reverse, however is not true).

Well, thats all for now. If you do not understand all of these terms discussed here, that is perfectly ok. We will start with the basics next time, so there's no need to worry.

Next lesson: Setting up your computer, and writing your first program.

0 comments: