Hello world!

In September of 1988 I was holding a copy of K&R’s The C Programming Language and tried to understand the first C program, the original Hello World. C looked alien to me.

Fortran had been my first programming language in college. The school had a PDP-11 or some DEC machine that had been donated to the school by Digital Equipment, and we used it to compile our assignments.  We had to schedule time in the lab, and that’s where I had my first experience in “concurrent programming.”  The compiler (called the TKB, an acronym that I was never interested in knowing what it meant) was not multi-user, so every time you wanted to compile your program, you’d literally had to stand on your chair and yell “I’m going to use the TKB.” That would be the signal for other users to wait before submitting. Once the compiler was done you would “unlock” the TKB by yelling again and life was good…except when someone wanted to mess up your work and would submit the job simultaneously. There was no “event log” that would say who the offender was, so you would just curse and move on.

Back to C. After college I had enrolled in a class and at the end we had to deliver an implementation of Tic Tac Toe.  Having been an avid chess player during high school, I was excited to come up with the magic formula that would evaluate the position and perused through some books that had something on game theory and stumbled on what looked like a good algorithm for the game. The instructor had given us loose instructions on the user interface, but he preferred a GUI.

Having no time and no money, only a copy of Turbo C, and not willing to invest time in a GUI that came in one of the C books from Herb Schildt due to several bugs I had to solve for it on another project, I decided to tackle the project using the algorithm, but alas, there was a problem position where the evaluation function would fail and the computer would lose.  So I injected a “special case” to make sure that the function would safely make it should it encounter the losing position.

At the end of the project, the other two teams got a beautiful user interface–and both teams used Pascal and not C–but my ugly baby with a command-line interface, writing O and X and asking for the coordinates of the next move, was the only one that would not lose.

I did not get the best grade, though.

This entry was posted in concurrent programming, software. Bookmark the permalink.

1 Response to Hello world!

  1. Brij Bhushan says:

    Wow what great post about hello world, I never read such a blog before, this is very interesting!

Leave a comment