Ed Yourdon's foreword to Who's Afraid of C++?

by Steve Heller

Argh! Another "Programming for Dummies" book! I have to admit that when Steve Heller prevailed upon me to read his manuscript and prepare a preface for this book, I had serious misgivings. Steve is a talented, articulate fellow, and I've enjoyed corresponding with him on the Internet for the past few years — ever since he gleefully pointed out in one of his earlier books (Efficient C/C++ Programming) that I had made the outrageously shortsighted comment in my 1975 textbook, Techniques of Program Structure and Design, that "unless you're very rich or very eccentric, you'll never have the luxury of owning your own computer."

Still, I dreaded the task of reading his entry-level programming book: almost every one I've read during my career has either been deadly boring, or childishly condescending, or both. Imagine my surprise, then, when I discovered that Who's Afraid of C++? was not only a good book, but an exciting one. Because I'm writing these words in mid-February 1996, you won't be impressed when I tell you that it's the best computer book that I've read in 1996 — so let me put it more strongly: this is the best technical book I've read since Zen and the Art of Motorcycle Maintenance appeared in the late 1970s.

Before I explain this rather bizarre analogy, let me address the central theme of Who's Afraid of C++?: learning a new programming language. Anyone who has gone through this process knows that it isn't easy. True, there are languages like LOGO and Basic that can be taught to novices within short periods of time; one of my most enjoyable experiences in the computer field was teaching LOGO to a group of 6- and 7-year-old children during a two-week summer class on Fire Island. But languages like C++ — the subject of Heller's book — are far more difficult, not only for novices but for veterans of other programming languages. Ask any COBOL programmer whether he found it difficult to absorb the intricate syntax and arcane vocabulary of C++ and you're likely to get a groan.

But for many of us, C++ has become a prerequisite to continued employment in the software industry. Groan though they may, more and more COBOL programmers are making the transition — for the simple reason that mainframe applications are being replaced by PC and client-server apps, and a lot of them are written in C++. Even if the main part of an application is written in a simpler language like Visual Basic, it's likely that some portions (e.g., the VBX components) will have to be programmed in C or C++. I often joke that C++ is the assembly language of the 90s, but I sometimes forget to remind my friends that assembly language was the first language I learned, and I would have been very nervous trying to program in any higher-level language if I didn't have a good idea of what was going on at the level of hardware registers and memory addresses.

Does this mean that all of today's veteran programmers will be required to learn C++? Well, perhaps not: after all, vast numbers of programmers have managed to make a comfortable living by creating applications in high-level languages without really understanding what was going on "under the covers." Judging from the employment ads in the newspapers, you can get a job today if you speak Visual Basic, PowerBuilder, or Smalltalk; but your odds of getting (or keeping) a programming job are usually much better if you also know C++. And for the beleaguered COBOL programmer, that's a key point to remember: whether it's fair or not, languages like Visual Basic are often regarded as "toys", while C++ is considered a "serious" language for building today's industrial-strength applications.

I got an inkling of the nature of this sea-change in programming languages in late 1995, at a panel session discussing IBM's newly-released version of object-oriented COBOL. It's an exciting, powerful new language, and I think that one could make a strong argument that OO-COBOL is a more logical migration path for today's legacy COBOL programmers and vintage-1972 application programs any other alternative. Nevertheless, when I asked the audience of some 100 people — all of whom were COBOL fans of one kind or another — whether they would advise their children to learn COBOL if their children intended to pursue a programming profession, less than 5 percent raised their hands. I didn't have the opportunity to see how many would have recommended C++, but it's virtually certain that the number of raised hands would have been far higher.

In mid-1995, another reason for learning C++ appeared on the horizon without any advance warning: the introduction of Sun Microsystems' "Java" language. Unless you've been living in a cave for the past few years, you know about the frenzy surrounding all aspects of the Internet and the World Wide Web; and you may have heard about Java as the language that promises to bring "live content" to Web pages. As I write this foreword, it's too early to tell whether Java really will revolutionize the Internet to the degree promised by its supporters, but there is one thing for sure: Java is a subset of C++, and if you've learned C++, it will be a lot easier to learn Java.

On the other hand, that raises an interesting question: why not learn Java first, and just forget about C++? It's similar to the argument one often hears about the relationship between C and C++. Presumably, it's a lot easier for an experienced C programmer to learn the additional syntax of C++, though the object-oriented paradigm supported by C++ typically requires a great deal of "un-learning." Similarly, one can assume that an existing knowledge of C++ will make it easier to learn Java — but since one of the most important aspects of Java is what it eliminates from the C++ language (e.g., pointers), there is a certain amount of un-learning required here as well.

All of this is particularly relevant for the novice programmer, who typically has no prior programming experience, and who barely has the time and patience to learn one language, let alone two or three. If we knew that we were going to be developing all of our applications to operate on the World Wide Web, and if we knew for certain that Sun would be able to withstand the onslaught of Microsoft and its Internet-friendly version of Visual Basic, maybe we could recommend to the novice that she skip C and C++ and just focus on Java ... or, following the lead of Netscape, perhaps learn only the "Java-lite" language known as JavaScript.

But we need a reality check here. For the time being, it's safe to assume that there will be a lot of programs that do not run on the Web. As of late 1995, the number of personal computers was estimated to be in the range of 200-300 million worldwide, but the number of Internet users has been pegged at the far lower figure of 30 million. Each of the 300 million PCs is a candidate for C++ programming (not to mention all the mainframes and mid-size machines). As for the Internet: well, if you express the number of Internet users as a fraction of the human race, it still rounds to zero. In any case, if Java does become a dominant language in the next few years, I'm confident that Steve Heller will be able to produce a modified version of Who's Afraid of C++? with the same dramatic success.

None of this explains why an utter novice who does not intend to become a professional computer programmer should necessarily learn to program in C++, or why she should learn to program in any language. There has been a great deal of debate about this since PCs first invaded the mainstream of society a dozen years ago; colleges, high schools, and even some elementary schools have adopted — and then sometimes abandoned — a policy that students should learn computer programming for the same reason they learn biology or chemistry or geometry. Indeed, one could argue that the odds are far higher that you'll need to write a small computer program (or at least have a decent understanding of the logic behind an existing program) in your day-to-day life than the odds of being forced to prove the Pythagorean Theorem or dissect a frog or recite the chemical composition of aspirin.

But I'm not going to pursue this argument; after 30+ years in the software industry, I'm biased, and I suspect that professional educators are equally biased. And it really doesn't matter; regardless of the opinion of advocates and opponents of compulsory programming courses, the practical reality for the adults or college students who are the likely readers of Steve Heller's book is that it's a personal choice. And this is a key point: quite aside from the technical intricacies of syntax and structure, learning a programming language is an intensely personal experience. It's often agonizing, it's sometimes tedious (especially if you don't have the proper tools!), and it's occasionally fun. On very rare occasions — perhaps only once a year, and sometimes only once or twice in one's career — it's more than fun: it's exhilarating, it's a rush, it's a shot of pure adrenaline. For some, it's almost a religious experience. And religious experiences, no matter how much we talk about them or write about them, are ultimately personal experiences. In the case of programming, that personal experience is also solitary in most cases, for it occurs at 3 in the morning when you're exhausted and frazzled and at your wit's end, and about to give up — and the program you've been sweating over finally gets up on its hind legs and runs.

It's the personal nature of the programming experience that makes Steve Heller's book such an unexpected and powerful masterpiece. As you'll see from the outset, it was not a solitary experience, but an ongoing dialogue between mentor and student — not a make-believe student, but a real one. Perhaps it's a bit unfair comparing X to Robert Pirsig's Zen and the Art of Motorcycle Maintenance, for Mr. Heller and his student appear not to suffer the same degree of psychic trauma as the characters in Mr. Pirsig's book. But the personal drama is intense nonetheless, and it would be interesting to read even If you had no interest in the technical subject matter. Assuming that you do intend to learn C++, the dialogue between the teacher and his often-frustrated student will suck you into a deeper level of involvement and participation than would ever have been possible in a normal "programming for dummies" book.

For those devoid of any emotion or interest in personal relationships, it's possible to skip over this part of the book and focus entirely on the technical stuff. It's all there, and it's all accurate, and it's all well-written. But there are other computer books of that ilk (even though very few at the introductory level), and the problem is that your mind begins to wander, about halfway through each chapter; by the end of the chapter, you can't even remember what the topic was. Such a fate is not likely with Steve Heller's book.

One last note: everything I've written here identifies Steve Heller as the sole author of Who's Afraid of C++?. But his student, who is introduced to us only as "Susan," is definitely more than a student; by the end of the book, she has become a full-fledged collaborator and approaches the status of co-author. I congratulate Steve for having written a superb piece of technical work, but I have some personal words of admiration for Susan: I offer you my congratulations for having the energy, the intellect, the tenacity, and the passion to bring this collaboration to its fruition. You did a helluva job — and it promises to be a long collaboration indeed, stretching far beyond the final page of the book. As my friends in New York City often like to say about such developments; Mazel tov!

Ed Yourdon
New York City
February 1996

 

 

For more information, please visit Ed's companion site here.
You may also visit Ed's blog here.