Rogue is a dungeon crawling video game first developed by Michael Toy and Glenn Wichman around 1980. It is generally credited with being the first "graphical" adventure game, and was a favorite on college Unix systems in the early to mid-1980s, in part due to the procedural generation of game content.

-- http://en.wikipedia.org/wiki/Rogue_(computer_game)

Wednesday, May 5, 2010

What is a Programmer?

One of my math professors in college once was asked "What is a mathematician?" He then wrote the following on the board:



Then he said, "A mathematician is someone who knows that the answer to this equation is square-root of pi." This is the Gaussian Integral and is fundamental to most of probability. The trick to solving this is to making it look more complicated to make it easier. In the end, the additional "complication" really was just a means of making the solutions much easier and more elegant.

I have found the similar type of situation for a C programmer. Here is a line of code that I have been staring at for over a day:

qsort ((void**) lineptr, 0, nlines-1,
(int (*)(void*,void*))(numeric ? numcmp : strcmp));


(Those of you playing at home, this is on K&R p. 119)

Pointers to Functions, casting void pointers to pointers and cryptic single line constructs. (Okay the ": ?" notation isn't that cryptic, but that is another post.) In short a C Programmer is some who not only knows what is going on in the above snippet of code, but can create similar code when it is needed.

I like C because of pointers. Tough it was in PERL that I personally understood how and why they work. There have been many times with other languages that I went, "I wish I had pointers."

0 comments:

Post a Comment