3 ms·
Respectable CS coders I've seen "never" code like that. Jeremy (among others) have always said that you should "always" use parenthesis when not using them make
by pooriaazimi 14y ago
Respectable CS coders I've seen "never" code like that. Jeremy (among others) have always said that you should "always" use parenthesis when not using them makes code ambiguous even in the slightest bit.
So, you should write than as
coffee.height (drink coffee, e.angle)
Also, understand that you can use parenthesis in a lot of places to remove ambiguity:
setTimeout (
# ...
), 400
instead of
setTimeout
# ...
, 400
Or
doSomethingWithHashAndOtherVars {
var1: 1
var2: 1
var3: 1
}, var4, var5
instead of
doSomethingWithHashAndOtherVars
var1: 1
var2: 1
var3: 1
, var4, var5
-------
Rule of thumb: When in doubt (or fear of future doubt), throw a couple parens around expressions, and a couple braces around objects.
- tjholowaychuk 14y agolooks terrible either way
- OriginalSyn 14y agoAs a rule of thumb I use braces and parens as a standard. I think making parens and braces optional was a mistake and they are necessary punctuation to the language. There is simply too much ambiguity without them and then when you're mixing and matching things become unreadable.