PDA

View Full Version : If you could talk to yourself 4 years ago...


sabotai
06-06-2004, 09:52 PM
I'd tell myself to COMMENT YOUR DAMN CODE!!!

For the project I'm working on now, I'm going through one of my old, failed sport sims (programmed in Delphi). According to the timestamp of the files, it's been since lat December of 2000 since I work on this thing. Now, it's June of 2004 and I'm trying to figure out what all this code means.

Not one comment. Nothing. It's Delphi, so it's not bad (it's inherently easy to read the code), but damn, if I had just thrown in some general comments, I could go right to the part I need. Instead, I have a file open that is a little over 1000 lines of code trying to find what I need and what all this code does. (actually not that bad, I've seen far worse)

Not only that, but I'm seeing some seriously bad coding practices in this program as well. Makes me wonder, if only I knew back then what I know now, I wonder what I'd know now... :)

Lesson learned. Comment my damn code.

Mantle2600
06-06-2004, 10:06 PM
Makes me wonder, if only I knew back then what I know now, I wonder what I'd know now... :)

Lesson learned. Comment my damn code.

I think my head just exploded

sachmo71
06-06-2004, 10:13 PM
I would say..."don't change anything, but remember to enjoy yourself."

Glengoyne
06-06-2004, 10:26 PM
Ahh I have been there. I now incessantly comment my code. I comment procedures, I comment variables, I comment the beginnings and ends of control structures, I comment changes logical shifts , I comment to explain algorithms.

Even worse than coming across uncommented code, is running across thoroughly commented code, and not having a clue what they mean. You read the comment, and say to yourself "OK...Now what the Hell does that mean?" or "OK I initialize that variable...why on earth would I do it there?".

It just never gets better. I now just tell myself that when I type a comment I need to make sure it can be understood by a moron, because more than likely I will be the next one to read the code.

Kerry <---Just a note from my daughter