January 94 - C++ for Gurus
C++ for Gurus
Jeff Alger
Jeff Alger is a consultant and author internationally recognized as an authority in
object-oriented methods and technologies. He is coauthor of "Developing
Object-Oriented Software for the Macintosh." The material in this article was inspired
by his experiences developing a new seminar, "Advanced C++," now taught by him at
Apple Computer Developer University. The course deals with advanced architectures
for C++ programs. For information contact Developer University at
(408)974-4897 or (408)974-6215.
There is a growing community of disenfranchised C++ gurus out there, and you may
be among them; if so, this article is for you. No, I'm not talking to you beginning and
intermediate C++ programmers; you have dozens of books, loads of training classes,
multimedia-based self-help courses, magazines, mentors and cocktail parties galore.
Not that one more cocktail party would be a bad idea, mind you, it's just that for one of
the few times in my otherwise spotless diplomatic career, I'm going to be politically
incorrect and send you packing.
For just this once, I'm talking to the rest of you, and you know who you are. The sort of
person to whom an "overloaded function" isn't a boring social affair, an "overloaded
operator" doesn't work for the phone company and a "collection class" isn't a seminar
on raising money for charity. You cite the ARM frequently in casual conversation
(always pronounced "arm"), at least half the time correctly but who cares because no
one else in the room knows what the acronym means and you're not about to tell them.1
You're the sort who doesn't read those "sissy" books and, as a result, haven't found any
books about C++ worth reading since you browsed through the index of Lippman's book
after starting your first C++ compile.2,3 You don't just program in C++, your ideas
flow onto a digital canvas using brushes and a palette from Bell Labs. Well, you have
rights, too, and it's about time someone did something to keep you and others like you
from going stark, raving mad. To anyone I haven't thoroughly offended yet, glad to meet
you, come on in. Welcome to group therapy for C++ gurus. This is the first and
possibly the last article in a series on how to learn to stop worrying and love C++. It
is an outgrowth of a new three-day course I developed recently and now teach at Apple
Computer's Developer University, titled "Advanced C++" and targeted, not at C++
programmers, but at C++ architects.
The Zen of C++
The natural course of one's understanding of C++ is like rising on an elevator, with
each floor decorated quite differently from the one below.
Ding! First floor. C++ is a more reasonable C, strongly typed as long as you don't fool
around too much, and, hey, how about those nifty // comments? All the C
programmers that didn't want to go into management really needed a career path, and
Bjarne Stroustrup, bless his soul, dreamed up a doozy.
Ding! Second floor. C++ is a decent but not great object-oriented language that happens
to run blindingly fast by comparison to others. It's politically correct and sure to get
your project funded by top management. Heck, they might double your budget if you
mention the language often enough in your proposal. That's just as well, because no one
really knows how to estimate and manage C++ projects and as to tools lot of weather
we're having, eh?
Ding! Top floor, everybody out. Hey, where did everyone go? Sure is drafty up here.
C++ is really "yacc++,"4 not so much a language as a way of creating your own
languages, elegant not for its simplicity (like "jumbo shrimp," the terms "C++" and
"simple" grate on the ears when used in the same sentence) but because of its
potential. Lurking behind every gnarly design problem is a nifty idiom, a nice little
twist to the language that makes the problem melt away like the Wicked Witch of the