don't agree with me :wink Man, I aways commented my code very well, even to the point of over commenting (figured I can go back anytime and know what that line did). I gotten lazy and commented my code less and in some spots none at all. Well, went to work on a project I started a few years ago and one that I got lazy with commenting and I don't know what the hell is going on! Me of all people hard coded an error value in a check of eax and had to search high and low to find the meaning... even simple code I forgot what it meant or does after a few years of not seeing it..... I LEARNED MY LESSON and A LESSON TO BE LEARNED BY ALL....... COMMENT YOUR CODE no matter how simple it may seem at the time!
:bg
Muhahahaha, haven't we all. I am just rewriting some 10 to 12 year old tools of mine and I was only about half way to documenting my code properly that long ago. It comes back and haunts you every time.
Yeah, it requires a lot of discipline. The worst case is other people's code. The second worst case is own scarcely commented and "organically grown" code in a 10,000 lines source. The only thing that helps in such a case is a comfortable search function that yields a listbox and includes a NEAR feature. For GFA Basic, I wrote that feature many years ago, and could not live without. This one says find ColPen& NEAR PS_SOLID:
(http://www.webalice.it/jj2006/pics/Gfw_List.png)
Same for assembler:
(http://www.webalice.it/jj2006/pics/MasmBasic.png)
Of course, properly commented code would be even better. But that is theory. Practice is being lost and yelling for help :8)
we have all done it - and it is, of course, good to comment your code
however, sometimes you write simple trivials to do something one time
i think there is something to be said for writing code fast and furious
it is a little bit like playing speed-chess to sharpen your game
; Dont forget how you did this
Eh, I started to re-write the code and am figuring it out. My dreams started with a semi-colon last night :bg