SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Olly
Originally posted by Olivier Legat:
...what is a JavaDoc comment actually?
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
I'm with Stan here. I see writing code that needs a comment as a personal failure. Show me code that needs a comment, and I show you code that can be improved.
SCJP 5.0
Originally posted by Ilja Preuss:
I'm with Stan here. I see writing code that needs a comment as a personal failure. Show me code that needs a comment, and I show you code that can be improved.
"I'm not back." - Bill Harding, Twister
Originally posted by Kelvin Lim:
Comments aren't just for explaining how code works, though. I use comments mainly to explain why I decided to implement a feature or algorithm a particular way. This is especially useful in situations where there's an "obvious" way of doing things that actually turns out to have serious but subtle flaws. If I don't put a comment next to the code in question, it's quite possible that some future zealous but inexperienced programmer will attempt to "optimize" my code using the flawed implementation approach.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Jesper Young:
Sometimes I have to implement some complicated algorithms. In the code, I document the steps of the algorithm with one or two comment lines for each step.
Sometimes things are just not so simple that the code can easily be written so that it is self-explanatory.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Ilja Preuss:
Most often, those "whys" can actually be expressed in unit tests, which has a whole bunch of advantages over comments.
Do you have an example?[/QB]
SCJP 5.0
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|