Sunday, February 27, 2005

CS misc

In my current class our required text is written by Robert Sedgewick, a professor at Princeton. I've only owned it for the whole of five days, and already I've learned an incredible amount about c++.

Ironically, the primary catalyst of this learning is due to Sedgewick's style of coding. You can tell by the way he names variables and formats his code that he's a C progammer at heart. That means his code is incredibly compact, names are very short and capital letters are used frequently. He also does many things I have never seen most programmers do (namely if()continue and strange methods of function initialization). Suffice to say I spent a great deal of time simply trying to understand his code. Now I finally see what he's doing, picked up a few neat tricks, and have a much greater appreciation for good comments and format.

Its not just cryptic code however; his programming examples are many, and they are all used to create concise and powerful algorithms that have a wide variety of uses. I also discovered exactly why I was always taught to write classes as header files and implementation files. I always believed headers wee simply for orgainizational sake, not as an interface of functions and variables for a client program to use, nor did I realize that an implementation file could include more functions and variables than what was detailed in the header. I still can't figure out why Sedgewick organizes many of his files the way he does, or how I might use this knowledge in the future, but its still good to know.

We might get some snow tonight. I'm sitting with my favorite lady, my text and a Dreamcast. Let the snow fall.

1 comment:

Unknown said...

well, the snow is falling now.. a bit late, but it's the thought that counts, right?

(and i would not mind being snowed in with you in the least, dearest.. ^^)