ho, ho, ho
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
ho, ho, ho
John de Michele wrote:Frankey,
I would argue that in your second example, the method should have been named reverse() or reverseString(). Then you wouldn't need a separate comment on what the code is doing. That's what is called self-documenting code.
As for my documentation, my work doesn't have rules requiring me to document my code. However, since I actually want other people to be able to use it, I always use a combination of javadocs and self-documenting code. I very rarely use internal comments, because I try to make my code as clear as possible so that someone who is familiar with the language I'm coding in, or even a reasonably experienced programmer who doesn't know the language, would know what was going on.
John.
ho, ho, ho
http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
ho, ho, ho
straws are for suckers. tiny ads are for attractive people.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|