9 ms·
> The type of documentation you described - code comments and wiki entries - they don't need practice. Yes, they do. > They only need care. They need that, t
by dragonwriter 6y ago
> The type of documentation you described - code comments and wiki entries - they don't need practice.
Yes, they do.
> They only need care.
They need that, too, but “care” is what gets you to apply what you know of how to do it rather than neglecting it, but practice (and interactive practice with feedback, specifically) is how you develop the skill to make useful comments, and ideally only useful comments.
> If you know how to write a function that takes Foo and transforms it into Bar under conditions X and Y, you also know how to just append this above it:
Well, mechanically probably you know how to. But absent relevant practice you might not know that (assuming, for the sake of argument, that this is correct in context — and in many cases, IMV, it wouldn’t be as much of that seems to reiterate information that is contained in type signatures and thus violate the principle of single source of truth if placed in comments) you should prepend comments with that content, rather than none or some other content foe the function.