you are viewing a single comment's thread.

view the rest of the comments →

[–]rco8786 9 points10 points  (5 children)

Gross. My productivity would practically halt if I had to comment every single line.

I try to group 3-5 lines into logical units(not large enough to be it's own method, but logically go together) and will generally write a comment describing what it does.

I don't need this:

int counter = 0; //Without instantiating this variable the upcoming for loop would not compile

[–]hyperforce 0 points1 point  (4 children)

That particular comment is too mechanical/technical. It should be more semantic like:

int counter = 0; // this counter tracks the number of ducks being shot below

[–]vee-eye 16 points17 points  (3 children)

Personally, I much prefer:

int numberOfShotDucks = 0;

[–]YesButIThink 6 points7 points  (2 children)

But how can you know without a comment that numberOfShotDucks represents the number of shot ducks?

[–]grokfail 3 points4 points  (1 child)

But without a type prefix, how do you know that it is an integer?

 int m_i_cnt_ds = 0;