I finally got around to putting up a personal website at
http://www.jerith.za.net. There isn't much there yet, but the php seems to be working OK for now. I still want to put up a mini CMS news/bloggy type thing for the front page, but that'll have to wat a bit. I also need to put a footer in and add some more content. And comment the code. Yes, commenting code is good. Code should be commented. I guess I'll go comment it now...
While I'm commenting my code, I'll just explain why it isn't commented yet. The three items that are up there (as of today) are all very experimental and exploratory and change quite a lot while I'm playing. As such, comments written with the code get out of sync fairly quickly, and comments that describe code that's no longer there (or has changed in various subtle ways) are dangerous. Commented code is good. Planned code should be commented while it's being written. Exploratory code should be commented once it works. On the other hand, overcommenting code is just as bad as undercommenting it. I am rather disturbed at the number of times I've received code that looks like the following:
int main()
{
int i; /* i is an integer used in a loop */
for (i=0; i<10; i++) { /* loop from 0 to 9 */
printf("Hello World\n"); /* Display the text "Hello World" */
} /* End the loop */
}
Hmm. It seems my "shiny website!" announcement has turned into a "how to comment code" diatribe. Ah well, fortunately I only write this stuff and I don't actually have to read it. Look! An obvious distraction over that way! ----->
*sneaks off to comment the offending code*