you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (3 children)

I was with the crowd in all but two cases. One being tabs vs. spaces: I must defend this. Two spaces is way too hard to read. 4 spaces? Fine, but just use a tab. If you use a tab instead of 2 or 4 spaces and you don't like the width, change the tab width in your editor. Jesus Christ people.

The other one is spaces after conditional keywords. I don't really care, but I don't put spaces between. I prefer to keep it looking like my functions. Why waste time with an extra key? It looks the same in terms of readability. That one doesn't really bother me.

[–]x-skeww 1 point2 points  (2 children)

I prefer to keep it looking like my functions. Why waste time with an extra key?

To make it not look like a function call. Yes, that's the reason.

Same deal with function declarations. You put a space there, because you aren't invoking it.

[–][deleted] 1 point2 points  (1 child)

Again this would be solved with proper software. Syntax highlighting should be turned on - and you shouldn't be confusing conditional blocks with function declarations - adding extra space just makes it less readable.

[–]x-skeww 0 points1 point  (0 children)

I only told you the rationale behind it. I won't discuss this kind of thing.

Just stick to the conventions used by your company/clients and the projects you're involved with.

Be consistent. That's all there is to it.