Comments (45)

39 Name: #!/usr/bin/anonymous : 2006-05-26 09:12 ID:Heaven

>>37
That first comment is only helpful if you're using a language where reading input is more than one or two lines (which it might well be if you're writing C, etc).

The second comment would be more useful if you explained what bounds you're actually supposed to be checking. Let the comment say what the code is supposed to do -- if it then turns out to be doing something rather different in some edge case, you have an easy reference for the correct behaviour and can fix the code to match the comment. Without documentation of what the bounds actually are, next time you look at that bit of code the only thing you have to go on is what the code says -- and if the reason you're looking at the code is that it's doing something wrong, you're pretty much shit outta luck if you can't remember the actual bounds you were trying to check.

This thread has been closed. You cannot post in this thread any longer.