Tagged Questions
48
votes
13answers
6k views
Can commented-out code be valuable documentation?
I wrote the following code:
if (boutique == null) {
boutique = new Boutique();
boutique.setSite(site);
boutique.setUrlLogo(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getLogo());
...
4
votes
5answers
300 views
What is the right level of granularity for code commenting?
Commenting in code I believe is very important but recently I've been reviewing code that has left me wondering particular this one.
//due to lack of confidence with web programming leaving this ...
7
votes
6answers
858 views
Is it necessary to write a javadoc comment for EVERY parameter in a method's signature?
One of the devs on my team believes that it is necessary to write a javadoc comment for EVERY parameter in a method's signature. I do not think this is necessary, and in fact I think it can even be ...
17
votes
11answers
1k views
“// …” comments at end of code block after } - good or bad?
I've often seen such comments be used:
function foo() {
...
} // foo
while (...) {
...
} // while
if (...) {
...
} // if
and sometimes even as far as
if (condition) {
...
} // if ...
4
votes
4answers
264 views
Correct alignment when outcommenting code
Suppose I have some code
void some_block(void)
{
some_statement_1();
some_statement_2();
some_statement_3();
}
Now I wish to out-comment statement #2, but here I never can find a way ...
7
votes
9answers
637 views
What are your thoughts on Periods/Full Stops in code comments?
I saw this asked in the SO Tavern, so I'm posting the question here. I thought it an interesting question. (Of course it doesn't belong on SO, but I think it's OK here.)
Do you add periods (or, as ...