Subject: Bjarne Stroustrup's Final Confession
From: [email-masked] (Lars Duening)
Newsgroups: alt.folklore.computers

I just post this for a friend. -- Lars
---------------------------------------------------------------------------

PREFACE : This is said to be the final confession which Bjarne Stroustrup made
on a small conference about programming languages somewhen in summer 1992. I
have no clue whether it is true or just a forgery; but I think it is worth
public discussion in this newsgroup.

                BJARNE STROUSTRUP'S FINAL CONFESSION

"Why did I create C++ ? -- This is a question that people frequently asked me.
I my White Book, I said something about `event-driven simulations'.  Yes,
indeed, it *were* event-driven simulations I was going to program.  To be more
concrete : These simulations were just games -- adventure games.  I had 
problems to proceed with this in C, so I tried something else.  I tried LISP, 
but got lost in a jungle of parentheses.  I tried ADA, but all I got was a 
piece of junk which rather looked like a missile control program -- I erased 
it at once.  I tried SMALLTALK, and discovered the benefits of object-oriented 
programming, but SMALLTALK looked quite funny, and it had the disadvantage of 
being an interpreter language, rendering it quite useless for my attempt : 
you would have needed a SMALLTALK interpreter to run the games.

Thus, I decided to design my own language.  It should be a small, practical
compiler language.  Furthermore, I decided to make it as similar to C as
possible -- such that I could take over my C adventure game library with some
changes.  Thus began the era of the `hobbit languages'.

The first version was a language which I called `Bilbo'.  It was not really
compatible to C, but with a very C-like syntax.  It was more or less intended 
as a compiled SMALLTALK in the dress of C.  However, I felt free to parody 
some SMALLTALK features.  For example, the semicolon wasn't part of the 
language core, but simply a standard message.  It just returned the expression 
behind it.  Being sent to the result of the expression before it, its effect 
was that first the thing before it, and then that behind it was done.  I also 
removed things like `if' or `while' from the core as it had been done in 
SMALLTALK.

In fact, the language had, while SMALLTALK still had five reserved words, *no*
reserved words.  The language core was empty; anything in Bilbo was an
object, and objects were represented by identifiers.  The syntax was

<program> ::= {<identifier>}.

To get close to C, I employed a message type not implemented in SMALLTALK :
the prefix message.  It was placed before the object.  Here some examples :

        z = factorial (x+y)
            ^^^^^^^^^
        draw_line (p1,p2)
        ^^^^^^^^^
        if (x==0) foo(bar) else x=1/x
        ^^        ^^^      ^^^^
The object was written behind the message like a first argument.  Arguments of
the message were placed behind it, either in the shape of an argument list
together with the receiver (see example 2) or separately behind it (see example
3).  Furthermore, I built some weird things into the standard library, e.g. the
following two unary messages

        :-)       (`smile')                  always returned 42

        !#$%*?@   (`the 7 canonical curses') made the program core-dump

and some other little marvels.  The root class (the class of which all
other classes are subclasses) was named :

The_Big_FOO_that_stands_in_the_very_beginning_of_Life_the_Universe_and_Anything.

The messages :-) and !#$%*?@ were defined in this class so any object did
understand them.

But somehow, I didn't please my very much.  I changed many things, spawning
another language which I called Frodo.  This one added a further messages 
type :  the `arrow-to-the-left' message

        <object-expr> `<-' <message-id> [<argument list>>.

Like Bilbo, it was untyped.  Its successor Samwise gave up the `empty core
design'; in the next version, Meriadoc, I turned the message call operator
around :

        <message-id> [<argument list>> `->' <object-expr>.

This proved to be a bad move, and in Peregrin (which was, by the way,
typed as well as Meriadoc while Samwise still had been an untyped
language) the object receiving the message was put in the first place
again.  However, I forgot turning the arrow around which now pointed
*away* from the object.  I thought of correcting that, but then I realized
that this was the same syntax that was used for selecting members of a
pointer-referenced struct in C; and what else was an object variable
technically, than a pointer to a struct ?

Peregrin looked so much like C that I myself got confused.  It was nearly
an object-oriented superset of C, but no more than *nearly* : many things
which are correct in C didn't work.  I decided to modify the language
specification in a way to be truly upward compatible to C.

But I did not find a name which seemed appropriate for that.  First I intended
to use one of the more obscure hobbit names from the Lord of the Rings, but
this did not seem very appropriate to me because this new language had a new
quality which set it aside from all of its predecessors.  Some people began
calling it `D', but I simply spoke of `C with classes'.  It came into 
widespread use in our laboratory.  The next stage was improving the language.  
I added overloading, multiple inheritance, and other features.  Meanwhile, 
one of my colleagues, Mr. Miscitti, had coined the name `C++' for it.  But 
there was still one thing missing : a reverence to the holiest of all holy, 
the most magical of all magical, the most random of all random numbers, the 
Fundamental Cosmological Constant, the Answer : the number 42.  The hobbit 
languages had the smile operator, but that one was silly, and it was not 
taken over.  But scanning the list of proposed and suggested additional 
features for C++, I found a more subtle way to represent the number 42 in my 
language.

C++ has -- in its final version -- 42 operators and 42 keywords."
   _            _   __               _       __            _
  / \ | |  /\  | \ |       /\  |  | | \     |   |  |   |  / \  \  /    |
  \   |_| |  | |_/ |_     |__| |\ | |  |    |_  |\ |   | |   |  \/     |
==========================================================================
Joerg G. Rhiemeier
"The better, the better" -- my motto, english version
"Je besser, desto besser" -- mein Motto, deutsche Version