4 ms·
It seems like the removal of parenthesis is a bad idea, because it's bound to create a bunch of inconsistent code. Notice how all the rest of the code samples o
by seanalltogether 15y ago
It seems like the removal of parenthesis is a bad idea, because it's bound to create a bunch of inconsistent code. Notice how all the rest of the code samples on the page keep the parenthesis in?
- qrush 15y agoYeah, I'm undecided yet as to which is best. My colleagues seem to be promoting keeping the parens in. Typically when we try stuff like this I like to push it to the max to see how it feels, then scale back.
- bstar77 15y agoI approach this the same way I approach Ruby... I only use parenthesis when they improve readability of a confusing statement or are required (function call with another function call-with params-as a param). As you can see, this statement required parentheses ;-)
- stdbrouw 15y agoIt does create some inconsistency (even though CoffeeScript is in many ways one of the most consistent syntaxes I've seen) but you gain a lot in readability sometimes, and it makes it so easy to craft great domain-specific languages.
- Cushman 15y agoI find it's a good smoke test for readability. Use parens to bind up atomic expressions in a line. If there are too many parens on a line, it's a good sign that you should break it up into two instead. It wouldn't be better lookin' with more.