News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

I'm a dumbass for not commenting my code!

Started by Gunner, November 21, 2009, 06:19:45 AM

Previous topic - Next topic

Gunner

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!
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

hutch--

 :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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

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:


Same for assembler:


Of course, properly commented code would be even better. But that is theory. Practice is being lost and yelling for help :8)

dedndave

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

oex

We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Gunner

Eh, I started to re-write the code and am figuring it out.  My dreams started with a semi-colon last night  :bg
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com