Hello everybody!
Today I had an argument with a colleague about one of his comments as summary of a method. Mostly he is not writing any summaries but in this case he added one and it was a really bad one: It was not described what the method is doing, it assumed what the method maybe is doing. I have to add that this piece of code was not his own, it was legacy code.
I told him that in this case he should have never made any commentary, only after really checking what is happening there, because someone who does read his opinion as valid statement will not check by himself and screw up. He could have add "This is an assumption, please check for yourself." but he didn't. Even if no commentary was there it would be better because then the developer has to check for himself.
Personally I'm very strict on code documentation. That doesn't mean I comment every line of code but method, class, etc summaries are mandatory and additional lines for difficult code parts are helping too.
I have to add that I work in a team of 10 developers where no one writes code only for himself. Spending less time on code documentation means that other developers are spending more time to get the meaning of the code.
I'm not even able to say if I like no documentation less than this kind of bad documentation. But at the end I guess I spend more time with not documented than not good documented foreign code. So... I hate both. ;)
What do you think? You don't care or do you see these things in your daily work too? What is worse for you: no code documentation or bad code documentation?
Thanks!
Michael