Commenting in code
Tonight I was at server class with Chris waiting for class to start and so I decided to show him before class started how the SAJAX worked inside of the Glicky project we've been working on. Since I've spent the last weekend ripping my hair out at times because of SAJAX, I've got a pretty good understanding of how it works and such so I start showing him the way it works and while it now seems pretty simple to me, I realized quickly its actually pretty complex.
Midway through he's like "And Ruby on Rails wouldn't have been better than this?"
"No" I say but then I started thinking, why wouldn't Ruby on Rails have been as good as this. I realize now the reason is that I'd have to learn a whole other language to do the same thing and what I've got now seems to work just fine. Granted, it does seem to have some hiccups if I miss something.
But then Chris notices something else.
"Paul, you don't have one comment." Chris says to me.
I look at it and I'm like "Yeah, there's one." that's when I realized I'd written a whole list of PHP functions and a whole list of Javascript functions and I'd only put in one comment and that comment was only 8 words. My philosophy lately has been to just write things as fast as I can and figure out whet's wrong later. I guess I forgot to include comments because I know what my code does.
At least for now...
Later Chris goes, "You might not need the comments Paul, but I'm going to need them when I'm going over your code."