On why you should never leave out the space between ”if” and the expression that follows in JavaScript: The Good Parts:
I placed a space between ”if” and ”(” so that the ”if” didn’t look like a function invocation.
I’m just quoting this because it’s one of those little things that drives me nuts when people are sloppy about it.
May 27, 2009 at 8:32 pm
That’s interesting. I’ve never felt that syntax was confusing, even at a glance, especially since the thing in parens after the “if” is almost always a comparison expression. In fact, I think it looks sloppy to have a space, and I always remove it if I happen across it in code other people wrote…
May 27, 2009 at 9:32 pm
Whitespace is good.