Tuesday, April 26, 2005

 
Computers understand a language variously known as computer language or machine language. It's possible but extremely difficult for humans to speak machine language. Therefore, computers and humans have agreed to sort of meet in the middle using intermediate languages such as C++. Humans can speak C++ (sort of) and C++ is converted into machine language for the computer to understand.
In the early 1970s, a consortium of really clever people worked on a computer system called Multix. The goal of Multix was to provide inexpensive computer access to graphics, e-mail, and stock data. Of course, this was a completely crazy idea and the entire concept failed.
A small team of engineers working for Bell Labs decided to save some portion of Multix in a very small, lightweight operating system that they dubbed UNIX (Un-ix, Mult-IX, get it?).
Unfortunately for these engineers, they didn't have one large machine but a number of smaller machines each from a different manufacturer. The standard development tricks of the day were all machine-dependent, and they would have to rewrite the same program for each of the available machines. Instead, these engineers invented a small, powerful language, named C.
C was indeed a powerful language, and it caught on like wildfire. However, new programming techniques were devised (most notably object-oriented programming) that left the C programming language behind. Not to be outdone, the engineering community added these new features to the C language, and the result was called C++.
The C++ language consists of the following:
A vocabulary of commands that humans can understand and that can be converted into machine language fairly easily
A language structure (or grammar) that allows humans to combine these C++ commands into a program that actually does something (well, maybe does something)
The vocabulary is often known as the semantics, while the grammar is the syntax.
What's a program?
A C++ program is a text file containing a sequence of C++ commands put together according to the laws of C++ grammar. This text file is known as the source file (probably because it's the source of all frustration). A C++ source file carries the extension .CPP just as a Microsoft Word file ends in .DOC or an MS-DOS batch file ends in .BAT. The concept extension .CPP is just a convention, but it's used almost exclusively in the PC world.
The point of programming is to write a sequence of C++ commands that can be converted into a machine language program that does whatever it is that you want done. Such machine executable programs carry the extension .EXE. The act of creating an executable program from a C++ program is called compiling (or building — there is a difference, but it's small).
How do I program?
To write a program, you need two things: an editor to build your .CPP source file with and a program that converts your source file into a machine executable .EXE file to carry out your commands. The tool that does the conversion is known as a compiler.
Nowadays, tool developers generally combine the compiler with an editor into a single work-environment package. After entering your program, you need only click a button to create the executable file.
The most popular of all C++ environments is Microsoft's Visual C++, but the software is expensive. Fortunately, there are public domain C++ environments — the most popular of which is GNU C++. (Pronounce GNU like this: guh NEW). You can download public domain programs from the Internet. Some of these programs are not free — you are either encouraged to or required to pay some usually small fee. You do not have to pay to use GNU C++.
GNU stands for the circular definition "GNU is Not UNIX." This joke goes way back to the early days of C++ — just accept it as is. GNU is a series of tools built by the Free Software Foundation.
GNU C++ is not some bug-ridden, limited edition C++ compiler from some fly-by-night group of developers. GNU C++ is a full-fledged C++ environment. GNU C++ supports the entire C++ language and executes all C++ programs.
GNU C++ is not a Windows development package for the Windows environment. You'll have to break open the wallet and go for a commercial package like Visual C++.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?