|
|
|
|
|
|
|
The enhanced telephone (ET) behaves differently when receiving a call. Rather than ringing a bell, the screen lights up and a voice says, You have a call. The phone company doesn't know this, however. They don't send special signals to each kind of phone. The company just pulses the wire and regular telephone ring, electronic telephone trill, and ET speaks. Each phone does the right thing based on its understanding of the message from the phone company. |
|
|
|
|
|
|
|
|
New Term: C++ supports this idea that different objects do the right thing, through what is called function polymorphism and class polymorphism. Poly means many, and morph means form. Polymorphism refers to the same name taking many forms, and is discussed during Hour 17, Polymorphism, and Hour 18, Advanced Polymorphism. |
|
|
|
|
|
|
|
|
As object-oriented analysis, design, and programming began to catch on, Bjarne Stroustrup took the most popular language for commercial software development, C, and extended it to provide the features needed to facilitate object-oriented programming. He created C++; and, in less than a decade, it has gone from being used by only a handful of developers at AT&T to being the programming language of choice for an estimated one million developers worldwide. |
|
|
|
|
|
|
|
|
C++ Isn't Just a Better C |
|
|
|
|
|
|
|
|
It is true that C++ is a superset of C and that virtually any legal C program is a legal C++ program, but don't let that fool you. H.L. Mencken once said that Wagner's music is better than it sounds. Well, the leap from C to C++ is bigger than it looks. |
|
|
|
|
|
|
|
|
C++ benefited from its relationship to C for many years, as C programmers could ease into their use of C++. To really get the full benefit of C++, however, many programmers found they had to unlearn much of what they knew and learn a whole new way of conceptualizing and solving programming problems. |
|
|
|
|
|
|
|
|
The question inevitably arises: because C++ is a superset of C, should you learn C first? Stroustrup and most other C++ programmers agree: not only is it unnecessary to learn C first, it is a bad idea. This book assumes you are not a C programmer. If you are a C programmer, however, no problem. Read the first few hours for review and then hang on tight. You're not in Kansas any more. |
|
|
|
|
|