• Thirty years ago learning my very first programming language, I also hated documenting programs.

    Now, n+ languages later, and 30 years wiser, I document the hell out of anything but the simplest code.

    Sometimes I even document that. Especially when learning a new language or function. (Documenting someone elses code seems to really help my learning curve...)

    I also try to keep the documentation "reading level" somewhere around the 6th to 8th grade.

    Why?

    Because at 3:00am, after you've been burning your brain since 7:00am the previous morning, your brain no longer operates at the experience level you had when wrote the code.

    Just as importantly, if you've been dealing with one issue, and suddenly get hit with another one, you can switch gears a whole lot quicker if you're dealing with code that is well documented in a manner that doesn't require a lot of extra brainpower to decipher.

    And, if the junior programmer can understand the code, maybe, just maybe, I won't have to be up at 3:00 am trying to figure out what he did to break mine...

    Just my NSHO...

    Thanks, Bobw