Categories
humor

Whimsy – For Want of a Nail

William C. Wake, 5-27-97

Every disaster relies on innumerable little events. Any of them could have been side-stepped, and the disaster averted. It’s a funny feeling when you look back and realize that you were responsible for one of those events.

C++ is a programming language. It is unfair to call it a disaster, but its complexity certainly gives it the potential to contribute to a disaster.

During the late ’70s and early ’80s, “Pascal vs. C” was a big debate (much like Richard Gabriel’s interpretation of “MIT vs. New Jersey schools”). Both were procedural languages, at a time when structured programming (“no gotos”:) was a real issue. Both languages had procedures, while loops, and other requisites. Pascal was regarded as a “better language” (with cleaner syntax and better-regarded semantics) but C was becoming looked at as a “more useful language”.

The follow-on to structured programming was languages based on abstract data types (so-called “object-based languages”). These languages moved toward “data structure programming”. Ada represents one outgrowth of this approach. It is another large, complex language (as is C++).

There was another object-based language that enjoyed some commercial popularity: Modula-2. This language was invented by Niklaus Wirth (the inventor of Pascal). It addresses the problems Pascal had in building large systems, by using a module (library) concept.

In the summer of ’94, I’d finished work on my Master’s, and was ready to work on compilers. I had been ready since high school and college; I’d worked on half a dozen interpreters and small compilers, including studying Wirth’s original Pascal compiler. The machine I’d enjoyed the most was the VAX, from DEC. My brother and several friends had gone to DEC without detouring for a Master’s, so I had several people to recommend me. While visiting my brother, I was asked to interview.

I had expected a grueling interview, sort of an academic defense. One of the two groups I was to talk to was a project just starting up to do a Modula-2 compiler. It was a one-person project, looking to grow.

I was ready to talk compilers: parsing, code generation, tradeoffs in going to Pcode or straight to assembler, languages, whatever came up. So, I had one of the worst interviews of my life.

Looking back, I now know that the interviewer was looking for a programmer, not a compiler writer. I spent the first half of the interview answering questions at the wrong level, and never recovered from that.

The irony is, I am a good programmer. I’m not as fast as some people, but I have a clean style and I’m sensitive to mistakes. I’d have been an excellent choice for the job (one of the other DEC groups picked me up).

—–
The interviewer didn’t hire anybody that day, nor for several months afterwards. A few months later, the project was canceled.

I like to think that things would have been different if I’d been hired. Perhaps my enthusiasm and skills could have pushed that project over the edge into success. Modula-2 for VMS might have made it into the world.

DEC was high-flying company in the mid-’80s – it just looked hot. Their FORTRAN was popular. Many schools bought VAX hardware and taught Pascal with those systems. Modula-2 might have become the next teaching language. Unlike Pascal, it had more growth space for developing large programs. It would have been a natural evolutionary step from Pascal.

During that time, C was brought to the VAX, but not very well supported. Perhaps it was the suspicion that it was a “Unix tool”; it took dedication to write a VAX C 1.0 program, especially if it had to interface to other VAX/VMS languages. C++ was not on the radar screen yet.

There are several important object-oriented languages. Smalltalk represents one side, the consistent “objects all the way down” approach. C++ represents the “compiled to the metal” end of things. Eiffel is another object-oriented language; although it supports good engineering of software, it has never taken off.

Modula-3 is the other object-oriented language popular around the time of C++’s initial popularity. It was a research development at one of DEC’s labs. It was designed to add OO, persistence, and other capabilities to the Modula-2 approach.

C+ got much of its popularity from the ubiquity of C. With “everything” becoming object-oriented, C programmers loved being able to buy a new compiler and say, “Now I’m an object-oriented C++ programmer.”

C programmers couldn’t shift to Modula-3 so easily. Perhaps, if Modula-2 had become big enough, soon enough, Modula-3 could have been the growth path of choice. If I’d interviewed better, perhaps I’d have made Modula-2 a success on VMS, and could look back and say I’d helped make Modula-3 a success (if only in a small way).

Postscript
Java today fits an interesting position. Technically, it straddles the Smalltalk and C++ languages. Its growth base is the WWW, which gives it a velocity faster than it would otherwise have. It looks close enough to C that a C or C++ programmer can feel that learning it is a small step. Java is not a perfect language, but brings advantages similar to those of Modula-3. Perhaps it’s the new successor.