…Show last 245 lines
61 there were a language so complicated, so difficult to learn,
62 that nobody would ever be able to swamp the market with
63 programmers? Actually, I got some of the ideas from X10,
64 you know, X windows. That was such a bitch of a graphics
65 system, that it only just ran on those Sun 3/60 things..
66 They had all the ingredients for what I wanted. A really
67 ridiculously complex syntax, obscure functions, and
68 pseudo-OO structure. Even now, nobody writes raw X-windows
69 code. Motif is the only way to go if you want to retain
70 your sanity..
71
72Interviewer: You're kidding...?
73
74Stroustrup: Not a bit of it. In fact, there was another problem..
75 Unix was written in 'C', which meant that any 'C' programmer
76 could very easily become a systems programmer. Remember
77 what a mainframe systems programmer used to earn?
78
79Interviewer: You bet I do, that's what I used to do..
80
81Stroustrup: OK, so this new language had to divorce itself from
82 Unix, by hiding all the system calls that bound the two
83 together so nicely. This would enable guys who only knew
84 about DOS to earn a decent living too..
85
86Interviewer: I don't believe you said that....
87
88Stroustrup: Well, it's been long enough, now, and I believe most
89 people have figured out for themselves that C++ is a waste
90 of time but, I must say, it's taken them a lot longer than I
91 thought it would..
92
93Interviewer: So how exactly did you do it?
94
95Stroustrup: It was only supposed to be a joke, I never thought
96 people would take the book seriously. Anyone with half a
97 brain can see that object-oriented programming is
98 counter-intuitive, illogical and inefficient..
99
100Interviewer: What?
101
102Stroustrup: And as for 're-useable code' - when did you ever hear
103 of a company re-using its code?
104
105Interviewer: Well, never, actually, but....
106
107Stroustrup: There you are then. Mind you, a few tried, in the
108 early days. There was this Oregon company - Mentor
109 Graphics, I think they were called - really caught a cold
110 trying to rewrite everything in C++ in about '90 or '91. I
111 felt sorry for them really, but I thought people would learn
112 from their mistakes..
113
114Interviewer: Obviously, they didn't?
115
116Stroustrup: Not in the slightest. Trouble is, most companies
117 hush-up all their major blunders, and explaining a $30
118 million loss to the shareholders would have been difficult..
119 Give them their due, though, they made it work in the end..
120
121Interviewer: They did? Well, there you are then, it proves O-O
122works..
123
124Stroustrup: Well, almost. The executable was so huge, it took
125 five minutes to load, on an HP workstation, with 128MB of
126 RAM. Then it ran like treacle. Actually, I thought this
127 would be a major stumbling-block, and I'd get found out
128 within a week, but nobody cared. Sun and HP were only too
129 glad to sell enormously powerful boxes, with huge resources
130 just to run trivial programs. You know, when we had our
131 first C++ compiler, at AT&T, I compiled 'Hello World', and
132 couldn't believe the size of the executable. 2.1MB
133
134Interviewer: What? Well, compilers have come a long way, since then..
135
136Stroustrup: They have? Try it on the latest version of g++ - you
137 won't get much change out of half a megabyte. Also, there
138 are several quite recent examples for you, from all over the
139 world. British Telecom had a major disaster on their hands
140 but, luckily, managed to scrap the whole thing and start
141 again. They were luckier than Australian Telecom. Now I
142 hear that Siemens is building a dinosaur, and getting more
143 and more worried as the size of the hardware gets bigger, to
144 accommodate the executables. Isn't multiple inheritance a
145 joy?
146
147Interviewer: Yes, but C++ is basically a sound language..
148
149Stroustrup: You really believe that, don't you? Have you ever sat
150 down and worked on a C++ project? Here's what happens:
151 First, I've put in enough pitfalls to make sure that only
152 the most trivial projects will work first time. Take
153 operator overloading. At the end of the project, almost
154 every module has it, usually, because guys feel they really
155 should do it, as it was in their training course. The same
156 operator then means something totally different in every
157 module. Try pulling that lot together, when you have a
158 hundred or so modules. And as for data hiding. God, I
159 sometimes can't help laughing when I hear about the problems
160 companies have making their modules talk to each other. I
161 think the word 'synergistic' was specially invented to twist
162 the knife in a project manager's ribs..
163
164Interviewer: I have to say, I'm beginning to be quite appalled at
165 all this. You say you did it to raise programmers'
166 salaries? That's obscene..
167
168Stroustrup: Not really. Everyone has a choice. I didn't expect
169 the thing to get so much out of hand. Anyway, I basically
170 succeeded. C++ is dying off now, but programmers still get
171 high salaries - especially those poor devils who have to
172 maintain all this crap. You do realise, it's impossible to
173 maintain a large C++ software module if you didn't actually
174 write it?
175
176Interviewer: How come?
177
178Stroustrup: You are out of touch, aren't you? Remember the typedef?
179
180Interviewer: Yes, of course..
181
182Stroustrup: Remember how long it took to grope through the header
183 files only to find that 'RoofRaised' was a double precision
184 number? Well, imagine how long it takes to find all the
185 implicit typedefs in all the Classes in a major project..
186
187Interviewer: So how do you reckon you've succeeded?
188
189Stroustrup: Remember the length of the average-sized 'C' project?
190 About 6 months. Not nearly long enough for a guy with a
191 wife and kids to earn enough to have a decent standard of
192 living. Take the same project, design it in C++ and what do
193 you get? I'll tell you. One to two years. Isn't that
194 great? All that job security, just through one mistake of
195 judgement. And another thing. The universities haven't
196 been teaching 'C' for such a long time, there's now a
197 shortage of decent 'C' programmers. Especially those who
198 know anything about Unix systems programming. How many guys
199 would know what to do with 'malloc', when they've used 'new'
200 all these years - and never bothered to check the return
201 code. In fact, most C++ programmers throw away their return
202 codes. Whatever happened to good ol' '-1'? At least you
203 knew you had an error, without bogging the thing down in all
204 that 'throw' 'catch' 'try' stuff..
205
206Interviewer: But, surely, inheritance does save a lot of time?
207
208Stroustrup: Does it? Have you ever noticed the difference between
209 a 'C' project plan, and a C++ project plan? The planning
210 stage for a C++ project is three times as long. Precisely
211 to make sure that everything which should be inherited is,
212 and what shouldn't isn't. Then, they still get it wrong..
213 Whoever heard of memory leaks in a 'C' program? Now finding
214 them is a major industry. Most companies give up, and send
215 the product out, knowing it leaks like a sieve, simply to
216 avoid the expense of tracking them all down..
217
218Interviewer: There are tools.....
219
220Stroustrup: Most of which were written in C++..
221
222Interviewer: If we publish this, you'll probably get lynched, you
223 do realise that?
224
225Stroustrup: I doubt it. As I said, C++ is way past its peak now,
226 and no company in its right mind would start a C++ project
227 without a pilot trial. That should convince them that it's
228 the road to disaster. If not, they deserve all they get..
229 You know, I tried to convince Dennis Ritchie to rewrite Unix
230 in C++..
231
232Interviewer: Oh my God. What did he say?
233
234Stroustrup: Well, luckily, he has a good sense of humor. I think
235 both he and Brian figured out what I was doing, in the early
236 days, but never let on. He said he'd help me write a C++
237 version of DOS, if I was interested..
238
239Interviewer: Were you?
240
241Stroustrup: Actually, I did write DOS in C++, I'll give you a demo
242 when we're through. I have it running on a Sparc 20 in the
243 computer room. Goes like a rocket on 4 CPU's, and only
244 takes up 70 megs of disk..
245
246Interviewer: What's it like on a PC?
247
248Stroustrup: Now you're kidding. Haven't you ever seen Windows '95?
249 I think of that as my biggest success. Nearly blew the game
250 before I was ready, though..
251
252Interviewer: You know, that idea of a Unix++ has really got me
253 thinking. Somewhere out there, there's a guy going to try
254 it..
255
256Stroustrup: Not after they read this interview..
257
258Interviewer: I'm sorry, but I don't see us being able to publish
259 any of this..
260
261Stroustrup: But it's the story of the century. I only want to be
262 remembered by my fellow programmers, for what I've done for
263 them. You know how much a C++ guy can get these days?
264
265Interviewer: Last I heard, a really top guy is worth $70 - $80 an
266 hour..
267
268Stroustrup: See? And I bet he earns it. Keeping track of all the
269 gotchas I put into C++ is no easy job. And, as I said
270 before, every C++ programmer feels bound by some mystic
271 promise to use every damn element of the language on every
272 project. Actually, that really annoys me sometimes, even
273 though it serves my original purpose. I almost like the
274 language after all this time..
275
276Interviewer: You mean you didn't before?
277
278Stroustrup: Hated it. It even looks clumsy, don't you agree? But
279 when the book royalties started to come in... well, you get
280 the picture..
281
282Interviewer: Just a minute. What about references? You must
283 admit, you improved on 'C' pointers..
284
285Stroustrup: Hmm. I've always wondered about that. Originally, I
286 thought I had. Then, one day I was discussing this with a
287 guy who'd written C++ from the beginning. He said he could
288 never remember whether his variables were referenced or
289 dereferenced, so he always used pointers. He said the
290 little asterisk always reminded him..
291
292Interviewer: Well, at this point, I usually say 'thank you very
293 much' but it hardly seems adequate..
294
295Stroustrup: Promise me you'll publish this. My conscience is
296 getting the better of me these days..
297
298Interviewer: I'll let you know, but I think I know what my editor
299 will say..
300
301Stroustrup: Who'd believe it anyway? Although, can you send me a
302 copy of that tape?
303
304Interviewer: I can do that..