Sure coming up with a great algorithm can be fun, but programmers only get true freedom to express themselves in their comments. And it’s always fun when you are fixing a bug and run across a funny or ironic comment that you don’t recall typing but you can tell without a doubt that you were the one that wrote it. While looking through some code I wrote about a year ago, I ran across these comments and thought I’d share.
long numSubLists = (numPRC + (MAX_SUBLIST_SIZE - 1))/MAX_SUBLIST_SIZE; //this math is right.. work it out if you don't believe me. :)
Assert(numReturned == returnSize); //this could only be false if something is broken hard...
PS: assertions are awesome. I’ve found nothing else to be better at preventing future programmers (especially myself) from breaking my code.
September 27, 3:03 pm
Trailing comments make me sick to my stomach.
September 27, 11:58 pm
I like my comments above the codex0rs