Hello… A new long journey with another great programming language: C++.
C++ is a high-level, general-purpose, object-oriented, and compiled programming language. It was invented by Bjarne Stroustrup in 1983. Formerly known as “C with Classes”, the C++ language is considered as an extension to the C language. Although some references consider them two totally different languages, I vote against this opinion, and I have my own reasons from my personal experience. My first gate to the computer programming world was the C language. In 1997, I started learning C. The next year (1998), I switched easily and smoothly to C++. The reason for this smooth transition wasn’t because I am genius or something, but because they are really similar languages. Starting from the C language that was invented in early 1970’s, C++ was derived, and has added its own new unique features and capabilities that the ordinary C language lacks. That is why C is considered as a subset of the C++ language.
Another important point that deserves mentioning is that knowing C is not a prerequisite to learning C++; so you can start learning C++ directly, with no prior knowledge of C language. Cheer up!!!
Next, the normal question is asked: Why C++?
Well. To better answer this question, we should first know the features of the C++ language.
Object Oriented: C++ supports OOP. Object Oriented Programming allows modeling real life entities into programmable objects which have attributes and behavior. This addresses the limitations in the traditional programming languages.
Internationally Standardized: C++ is ISO standardized. In 1998, the International Organization for Standardization (ISO) had recognized C++ as ISO/IEC 14882. Since that date, several reviews have been made on the standard, until it reached its current release ISO/IEC 14882:2014. Being certified and standardized by a well-known organization like ISO is an important indicator that shows the wide acceptance C++ had (and still having) in the world of computer programming.
Firm and Strict Syntax: yes, you have read it correctly, and nothing wrong with your eyes.
– How could strict syntax be an advantage?! This is ridiculous!!!
Okay, being strict will take some effort from you in the beginning. In the learning phase, you will have to pay extra attention to avoid typing errors, unnecessary space characters, undeclared variables, etc. Once you complete the learning phase successfully, and your hands get used to writing C++ code, you will see how such strictness helps you ensure bugs-free code, and avoid unexpected execution results. You don’t believe me now. So, just wait and you will see!!
Very High Performance
C and C++ have great performance compare to other languages. This shouldn’t be strange when you know that the UNIX kernel was written in the C language. Could you imagine?! The kernel, which is the closest layer to the hardware, and contains the necessary drivers to manage the CPU, Memory, and I/O: How fast should this component (Kernel) be?!!
When performance is an issue, use C/C++.
Compiled: like its parent (C language), C++ is a compiled language. When a language is said to be compiled, this means that programs written in this language should be compiled before being executed.
Besides to the above features (that I really consider as advantages), learning C++ gives you another advantage if you are planning to learn Java or C#. Learning C++ will take you a long way in both languages. (Great advantage, huh!!)
Preparing our Environment
To write our C++ programs, we need a suitable development environment. In this series of articles, I am going to use Turbo C++ for Windows. In the next section, we are going to learn how to get this software, and how to install it on our Windows desktop machines.
Downloading and Installing Turbo C++ on Windows Machines
The following is the procedure to follow to download and install Turbo C++ on our Windows PCs:
1) In your web browser, browse to http://sourceforge.net/
2) In the search box, type Turbo C++, then press Enter.
5) In the following page, click download. The download should start within few seconds.
6) When the download is complete, double-click the installation file. The installation is quite easy; just Next, Next, Install.
7 )The installation takes less than a minute. When complete, it creates a shortcut on the desktop.
A Quick Tour in Turbo C++
To start the Turbo C++, go through the following procedure:
1) Double-click the newly-created desktop shortcut. A DOS-Like window is started, and fills the entire screen.
2) To open a new file for writing C/C++ code, click the File menu, and then click New.
3) An Editor sub-window is open for editing.
Now, you are ready to start writing C++ programs. Congratulations!!!
* * * * * *
In this article, we had an introduction to the C++ language, the language that came to life in 1983. We have talked about its history and its features. Then we discussed why someone should learn and use C++. We have seen that C++ is object-oriented, recognized as an ISO standard since 1998, and gives very high performance. Mission critical applications that require high performance are written in C/C++ language. We have also illustrated how to get and setup Turbo C++ on our Windows machine.
That was part one in a long series of articles to come. So, stay here; a lot of knowledge is on the way to you. Thanks.