9 ms·
> no white space after the keywords if, for, while, etc. Woh, my workplace enforces the exact opposite! The idea is that if, while, etc are not functions, the
by shared4you 13y ago
> no white space after the keywords if, for, while, etc.
Woh, my workplace enforces the exact opposite! The idea is that if, while, etc are not functions, therefore `if (x)` is unacceptable but `my_func(x)` is ok. I personally prefer `if(x)` though.
- oddthink 13y agoI think most places enforce the opposite. There's a strain of very-little-space style out there, but I'm not sure where it comes from. Maybe Pike, for all I know: http://www.literateprogramming.com/pikestyle.pdf http://www.literateprogramming.com/pikestyle.pdf is certainly rife with it.
- qznc 13y agoThere is no right or wrong here. The important thing is consistency across a project.
- maw 13y agoSpaces before parens doesn't matter too much, but with respect to spaces before commas all relativism goes straight out the window: putting a space before a comma is objectively better practice.