3 ms·
That's very dismissive of a very real problem. When you add friction to comments, people either a) Don't write them in the first place. b) Don't keep them up t
by corresation 13y ago
That's very dismissive of a very real problem. When you add friction to comments, people either
a) Don't write them in the first place.
b) Don't keep them up to date (as to3m mentioned, it is utterly ridiculous when you need to update a comment and then need to reflow every following sentence. Many developers will simply not do it).
Additionally another counterpoint seems to be "my comments are short anyways", which would make me question why comment in the first place? In most cases where I've seen short comments, they were completely unnecessary redundant restating of exactly what the code already tells you.
The comments that really add real value don't try to pseudo-code the code, but instead tell you the why of the code. It is extremely hard to describe why in 80 characters or less.
- to3m 13y agoYes, I've found this too. Comments that are useful to more than just the original author tend to be at least 2-3 sentences long. It's hard to fit that many sentences into 80 characters, a total which is already being eaten away by indentation and comment prefix. (For example, your average C# function will be indented 2 stops. C++ member function declarations will be indented 1 or 2 stops. In both these cases you also lose 2 or 3 chars from the leading "//" or "// ".) Before I used Comment Reflower, I used one of the example VBA macros that comes with Visual Studio. It was rather slow, and somewhat buggy (you're much, much better of with Comment Reflower) but it would - usually - word wrap your comments without making too much of a mess. But I noticed my comments improving in quality pretty much the moment I started using it, because finally I could say as much as needed to be said without it being a bother to keep things nicely formatted, or having to even think about the effort of keeping it up to date later.