3 ms·
To be honest it's not a problem I have, I like to keep my comments short and punchy. If I'm writing war and peace, it will only ever be for the class comment a
by TheAnimus 13y ago
To be honest it's not a problem I have, I like to keep my comments short and punchy. If I'm writing war and peace, it will only ever be for the class comment at the top, for some reason I manually do my own line breaks then as I feel it can be used to break up thought and provide emphasis.
However, I'm also a GhostDoc fan:
http://submain.com/products/ghostdoc.aspx http://submain.com/products/ghostdoc.aspx
So I appreciate some people consider me to be inherently evil/lazy.
- noselasd 13y agoEven if it's a problem you'd have, you really have a luxury problem if having to press enter when writing comments is the thngs you worry about when delivering code.
- pessimizer 13y agoNot if you kill yourself after the 9000th time you've had to do it. Death is a real hardship for people of all income levels.
- corresation 13y agoThat'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.
- to3m 13y agoNot evil/lazy - after all, what could be less lazy than spending all that time pressing return and reformatting your comments? Just, to my mind, a bit unusual. Manual word wrapping reminds me of the days before copy and paste and undo, which (due to my age) thankfully didn't last all that long for me. I personally do not want ever to go back to that time, though I suppose for some the idea might seem attractively quaint ;)