Commenting your code

I suppose you're right about that. Still, though, when commenting your own code, I still maintain that you should treat protected members as public ;)
 
I've written a whole project and the code:comment ratio must be like 99:1 ..! It's not deliberate but the code has turned out very readable so commenting it wouldn't be anything more than a waste of time :p

I only really comment cryptic bits of code - ones that aren't blatantly obvious as to what their function is.
 
to a certain degree, I'd definitely agree with that, but sometimes I go back to things and I'm like "what was I smoking when I wrote that?!?!", so I do tend to do a bit of commenting around parts that I think are going to bend my mind later. If it's something that's quite involved and can be used elsewhere, I might write an example of usage as a mini guide on how to use it.
I'm the opinion that if it requires a comment, it needs refactoring. It'll need chopping into smaller pieces until it is bite sized and easy to read :)
 
Comment class methods with brief description, parameters and return values, mainly out of habit. Rarely comment elsewhere unless someone else may see it or be using it - if it's confusing logic I'll either rewrite it or dump some commented examples in a .txt somewhere.
 
If I remember I do, but more often than not I forget to put anything in the code, I then come back a year later and go WTF:confused: and it takes me ages to figure out what I did. As I don't code very often now, I get a bit rusty :)
 
Back
Top Bottom