April 12, 2005

Geeks love lame jokes

I want to debunk a myth that I came across recently. Its a myth that I initially came across when I took CMPSC 201C in my sophomore year at Penn State. The class was a programming course for engineers and scientists and revolved around the C++ programming language. The myth, very popular with non-programmers and those new to programming is:
    C++ is an evolution of the C+ language and that the C+ language was dervied from C.
The problem with the myth is that there never a C+ language. This myth is the result of geeks loving lame jokes, recursive acronyms, and puns that only they understand.

The C language was developed between 1969 and 1973 by Dennis Ritchie and Ken Thompson. It was a direct descendent of the B, a language developed at Bell Labs by Ken Thompson. It was also written by Ken Thompson, with submissions from Dennis Ritchie. The C++ language was written by Bjarne Stroustrup at Bell Labs during 1983-1985. Initially written to be an extention of C, Stroustrup initially called it C with classes.

The name was coined by Richard Martin and is one of the oldest, most popular, and longest running inside jokes in the computer industry. The name is a play on the "++" operator that exists in both C and C++. As an example, lets say we have a variable called $X (think of variables to be like the value of "x" in algebra). Now we want to increase the variable by a value of one. Without using the "++" operator, the code in C or C++ would look like this:
    int $X;       /* Defines variable*/
    $X = 1;       /* Sets $X = 1 */
    $X = $X + 1;  /* Increases $X by one */
Now, programming has tons of shortcuts. Every language has them because programmers, like everyone else, are lazy and don't like to type more than whats really needed. The "++" operator could be considered such a shortcut. Here's how to increase a variable's value by one using the "++" operator:
    int $X = 1;   /* Defines variable = 1*/
    $X++;         /* Increases $X by one */
Therefore, the name is a play on words suggesting that C++ is "one" improvement over C. It also qualifies as a completely lame joke. I won't get into how it really should have been called ++C though.

0 Comments:

Post a Comment

<< Home