Quote:(09-19-2013, 05:47 AM)w00t Wrote: [To see links please register here]
No, form is pretty important when you're working with a team of people. If your code is ugly to read, that means its less likely to be read, which tends to lead to bad things.
DOX:
// This function
// will
// return
/* an array if
* it succeeds
*/
// and a null
// pointer
// if it does
// not
Programmer 1: Ain't nobody goin' care bout dis, its just whitespace
Programmer 2: Well fuck that shit, I'll just assume it errors if something goes wrong
<0day effecting the entire world>
Programmer 1: I clearly said it would return a null pointer!
Programmer 2: Fuck you, gumby, why would I read that shit
Very extreme example is extreme.
I never said it wasn't, any good programmer knows form is important or consistency. This doesn't mean that everybody has to use the same form. Look at the difference in the comment "form" he posted compared to what OP posted, that much difference is insignificant. Even so, what is the most important to look at there is the width of the comments, nobody writes a comment with one or two words per line like that. Everything else is preference, as long as it's consistent because the programmer should then know what to look for by seeing other comments in the code. Nobody writes code the same way, so the important thing is consistency; any programmer reading your code won't get caught off guard.
You too, missed the point of what I posted above (even though I thought it was pretty clear).
It was also more directed at the changes he made to the existing comment format OP had been using. Most IDE's have good syntax highlighting anyways along with intellisense that more clearly indicates the intentions of the programmer. Code clarity is still important today, but it was most important back when IDE's were just no better than notepad.
Also, OP never mixed comments like you did, so your extreme example was both not necessary and
extremely irrelevant in my opinion. You didn't even mention what was wrong with the comments you had in your example (although implications could be easily made), and you never posted your suggestion on what comments
should look like (your opinion). All of you posted the same old look OP did, in variation, while the main thing I see wrong is the width really:
Hidden Content
You must
[To see links please register here]
or
[To see links please register here]
to view this content.
Depending on the font used, and the length of the words in a line, I would say anywhere from 15-20 words per line is much better. And linespace used to break out key parts of what the comment is trying to describe.
I've even seen comments like this with double stars to keep everything vertically aligned. That is preference though, not any difference in clarity, which is the only important part about "form" as you describe it.
Hidden Content
You must
[To see links please register here]
or
[To see links please register here]
to view this content.
Some of the best programmers just use simple "//"s and some use the multi-line comments
normally.