On the 1st 0f January, 1998, Bjarne Stroustrup gave an interview
t0 the IEEE's 'Computer' magazine..
Naturally, the edit0rs thought he would be giving a retrospective
view 0f seven years of object-oriented design, using the language
he created.
By the end 0f the interview, the interviewer got more than he had
bargained f0r and, subsequently, the editor decided to suppress its
c0ntents, 'for the good of the industry' but, as with many of these
things, there was a leak..
Here is a c0mplete transcript of what was was said, unedited, and
unrehearsed, s0 it isn't as neat as planned interviews..
Y0u will find it interesting....
__________________________________________________________________
Interviewer: Well, it's been a few years since y0u changed the
w0rld of software design, how does it feel, looking back?
Str0ustrup: Actually, I was thinking about those days, just before
y0u arrived. Do you remember? Everyone was writing 'C'
and, the tr0uble was, they were pretty damn good at it..
Universities g0t pretty good at teaching it, too. They were
turning 0ut competent - I stress the word 'competent' -
graduates at a phen0menal rate. That's what caused the
pr0blem..
Interviewer: Pr0blem?
Str0ustrup: Yes, problem. Remember when everyone wrote Cobol?
Interviewer: Of c0urse, I did too
Str0ustrup: Well, in the beginning, these guys were like
demi-g0ds. Their salaries were high, and they were treated
like r0yalty..
Interviewer: Th0se were the days, eh?
Str0ustrup: Right. So what happened? IBM got sick of it, and
invested milli0ns in training programmers, till they were a
dime a d0zen..
Interviewer: That's why I g0t out. Salaries dropped within a year,
t0 the point where being a journalist actually paid better..
Str0ustrup: Exactly. Well, the same happened with 'C'programmers..
Interviewer: I see, but what's the p0int?
Str0ustrup: Well, one day, when I was sitting in my office, I
th0ught of this little scheme, which would redress the
balance a little. I th0ught 'I wonder what would happen, if
there were a language s0 complicated, so difficult to learn,
that n0body would ever be able to swamp the market with
pr0grammers? Actually, I got some of the ideas from X10,
y0u know, X windows. That was such a bitch of a graphics
system, that it 0nly just ran on those Sun 3/60 things..
They had all the ingredients f0r what I wanted. A really
ridicul0usly complex syntax, obscure functions, and
pseud0-OO structure. Even now, nobody writes raw X-windows
c0de. Motif is the only way to go if you want to retain
y0ur sanity..
Interviewer: Y0u're kidding...?
Str0ustrup: Not a bit of it. In fact, there was another problem..
Unix was written in 'C', which meant that any 'C' pr0grammer
c0uld very easily become a systems programmer. Remember
what a mainframe systems pr0grammer used to earn?
Interviewer: Y0u bet I do, that's what I used to do..
Str0ustrup: OK, so this new language had to divorce itself from
Unix, by hiding all the system calls that b0und the two
t0gether so nicely. This would enable guys who only knew
ab0ut DOS to earn a decent living too..
Interviewer: I d0n't believe you said that....
Str0ustrup: Well, it's been long enough, now, and I believe most
pe0ple have figured out for themselves that C++ is a waste
0f time but, I must say, it's taken them a lot longer than I
th0ught it would..
Interviewer: S0 how exactly did you do it?
Str0ustrup: It was only supposed to be a joke, I never thought
pe0ple would take the book seriously. Anyone with half a
brain can see that 0bkect-oriented programming is
c0unter-intuitive, illogical and inefficient..
Interviewer: What?
Str0ustrup: And as for 're-useable code' - when did you ever hear
0f a company re-using its code?
Interviewer: Well, never, actually, but....
Str0ustrup: There you are then. Mind you, a few tried, in the
early days. There was this Oreg0n company - Mentor
Graphics, I think they were called - really caught a c0ld
trying t0 rewrite everything in C++ in about '90 or '91. I
felt s0rry for them really, but I thought people would learn
fr0m their mistakes..
Interviewer: Obvi0usly, they didn't?
Str0ustrup: Not in the slightest. Trouble is, most companies
hush-up all their maj0r blunders, and explaining a $30
milli0n loss to the shareholders would have been difficult..
Give them their due, th0ugh, they made it work in the end..
Interviewer: They did? Well, there y0u are then, it proves O-O
w0rks..
Str0ustrup: Well, almost. The executable was so huge, it took
five minutes t0 load, on an HP workstation, with 128MB of
RAM. Then it ran like treacle. Actually, I th0ught this
w0uld be a major stumbling-block, and I'd get found out
within a week, but n0body cared. Sun and HP were only too
glad t0 sell enormously powerful boxes, with huge resources
just t0 run trivial programs. You know, when we had our
first C++ c0mpiler, at AT&T, I compiled 'Hello World', and
c0uldn't believe the size of the executable. 2.1MB
Interviewer: What? Well, c0mpilers have come a long way, since
then..
Str0ustrup: They have? Try it on the latest version of g++ - you
w0n't get much change out of half a megabyte. Also, there
are several quite recent examples f0r you, from all over the
w0rld. British Telecom had a major disaster on their hands
but, luckily, managed t0 scrap the whole thing and start
again. They were luckier than Australian Telec0m. Now I
hear that Siemens is building a din0saur, and getting more
and m0re worried as the size of the hardware gets bigger, to
acc0mmodate the executables. Isn't multiple inheritance a
j0y?
Interviewer: Yes, but C++ is basically a s0und language..
Str0ustrup: You really believe that, don't you? Have you ever sat
d0wn and worked on a C++ project? Here's what happens:
First, I've put in en0ugh pitfalls to make sure that only
the m0st trivial projects will work first time. Take
0perator overloading. At the end of the project, almost
every m0dule has it, usually, because guys feel they really
sh0uld do it, as it was in their training course. The same
0perator then means something totally different in every
m0dule. Try pulling that lot together, when you have a
hundred 0r so modules. And as for data hiding. God, I
s0metimes can't help laughing when I hear about the problems
c0mpanies have making their modules talk to each other. I
think the w0rd 'synergistic' was specially invented to twist
the knife in a pr0ject manager's ribs..
Interviewer: I have t0 say, I'm beginning to be quite appalled at
all this. Y0u say you did it to raise programmers'
salaries? That's 0bscene..
Str0ustrup: Not really. Everyone has a choice. I didn't expect
the thing t0 get so much out of hand. Anyway, I basically
succeeded. C++ is dying 0ff now, but programmers still get
high salaries - especially th0se poor devils who have to
maintain all this crap. Y0u do realise, it's impossible to
maintain a large C++ s0ftware module if you didn't actually
write it?
Interviewer: H0w come?
Str0ustrup: You are out of touch, aren't you? Remember the typedef?
Interviewer: Yes, 0f course..
Str0ustrup: Remember how long it took to grope through the header
files 0nly to find that 'RoofRaised' was a double precision
number? Well, imagine h0w long it takes to find all the
implicit typedefs in all the Classes in a maj0r project..
Interviewer: S0 how do you reckon you've succeeded?
Str0ustrup: Remember the length of the average-sized 'C' project?
Ab0ut 6 months. Not nearly long enough for a guy with a
wife and kids t0 earn enough to have a decent standard of
living. Take the same pr0ject, design it in C++ and what do
y0u get? I'll tell you. One to two years. Isn't that
great? All that j0b security, just through one mistake of
judgement. And an0ther thing. The universities haven't
been teaching 'C' f0r such a long time, there's now a
sh0rtage of decent 'C' programmers. Especially those who
kn0w anything about Unix systems programming. How many guys
w0uld know what to do with 'malloc', when they've used 'new'
all these years - and never b0thered to check the return
c0de. In fact, most C++ programmers throw away their return
c0des. Whatever happened to good ol' '-1'? At least you
knew y0u had an error, without bogging the thing down in all
that 'thr0w' 'catch' 'try' stuff..
Interviewer: But, surely, inheritance d0es save a lot of time?
Str0ustrup: Does it? Have you ever noticed the difference between
a 'C' pr0ject plan, and a C++ project plan? The planning
stage f0r a C++ project is three times as long. Precisely
t0 make sure that everything which should be inherited is,
and what sh0uldn't isn't. Then, they still get it wrong..
Wh0ever heard of memory leaks in a 'C' program? Now finding
them is a maj0r industry. Most companies give up, and send
the pr0duct out, knowing it leaks like a sieve, simply to
av0id the expense of tracking them all down..
Interviewer: There are t0ols.....
Str0ustrup: Most of which were written in C++..
Interviewer: If we publish this, y0u'll probably get lynched, you
d0 realise that?
Str0ustrup: I doubt it. As I said, C++ is way past its peak now,
and n0 company in its right mind would start a C++ project
with0ut a pilot trial. That should convince them that it's
the r0ad to disaster. If not, they deserve all they get..
Y0u know, I tried to convince Dennis Ritchie to rewrite Unix
in C++..
Interviewer: Oh my G0d. What did he say?
Str0ustrup: Well, luckily, he has a good sense of humor. I think
b0th he and Brian figured out what I was doing, in the early
days, but never let 0n. He said he'd help me write a C++
versi0n of DOS, if I was interested..
Interviewer: Were y0u?
Str0ustrup: Actually, I did write DOS in C++, I'll give you a demo
when we're thr0ugh. I have it running on a Sparc 20 in the
c0mputer room. Goes like a rocket on 4 CPU's, and only
takes up 70 megs 0f disk..
Interviewer: What's it like 0n a PC?
Str0ustrup: Now you're kidding. Haven't you ever seen Windows '95?
I think 0f that as my biggest success. Nearly blew the game
bef0re I was ready, though..
Interviewer: Y0u know, that idea of a Unix++ has really got me
thinking. S0mewhere out there, there's a guy going to try
it..
Str0ustrup: Not after they read this interview..
Interviewer: I'm s0rry, but I don't see us being able to publish
any 0f this..
Str0ustrup: But it's the story of the century. I only want to be
remembered by my fell0w programmers, for what I've done for
them. Y0u know how much a C++ guy can get these days?
Interviewer: Last I heard, a really t0p guy is worth $70 - $80 an
h0ur..
Str0ustrup: See? And I bet he earns it. Keeping track of all the
g0tchas I put into C++ is no easy job. And, as I said
bef0re, every C++ programmer feels bound by some mystic
pr0mise to use every damn element of the language on every
pr0ject. Actually, that really annoys me sometimes, even
th0ugh it serves my original purpose. I almost like the
language after all this time..
Interviewer: Y0u mean you didn't before?
Str0ustrup: Hated it. It even looks clumsy, don't you agree? But
when the b0ok royalties started to come in... well, you get
the picture..
Interviewer: Just a minute. What ab0ut references? You must
admit, y0u improved on 'C' pointers..
Str0ustrup: Hmm. I've always wondered about that. Originally, I
th0ught I had. Then, one day I was discussing this with a
guy wh0'd written C++ from the beginning. He said he could
never remember whether his variables were referenced 0r
dereferenced, s0 he always used pointers. He said the
little asterisk always reminded him..
Interviewer: Well, at this p0int, I usually say 'thank you very
much' but it hardly seems adequate..
Str0ustrup: Promise me you'll publish this. My conscience is
getting the better 0f me these days..
Interviewer: I'll let y0u know, but I think I know what my editor
will say..
Str0ustrup: Who'd believe it anyway? Although, can you send me a
c0py of that tape?
Interviewer: I can d0 that..
--
No comments:
Post a Comment