And if so, where do you draw the line? My coworkers and I disagree on this subject. I have seen such things as
// fixes bug # 22
to
// fixed bug: shouldnt be decrementing
i++;
Is it ok if the change is fairly significant, and radically changes what the method was written to do? Or do you simply change the summary text of the method to reflect what it is now meant to do?
My opinion is that this information should be put into source control. Some state that this is bad because then it will be lost outside of the context of source control (say you switch systems and want to keep historical data).
Comments should explain how the methods work.
Source control explains why changes were made.
Adding a comment about bug fixing is a good idea, if you write the right thing.
For example,
/* I know this looks wrong, but originally foo was being decremented here, and
it caused the baz to sproing. Remember, the logic is negated by blort! */
Stuff like Fixes bug #22
is better kept in source control. Comments in your code should be signposts to help future sojourners on their way, not satisfy process and tracking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With