Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

But here we're introducing brackets just to avoid the syntax ambiguity. The Pythonista in me is crying out for a single way of doing things, either require brackets or don't. It makes me want to go down the road of always using parenthesis in CoffeeScript, but then it'll feel like I'm not using the language in an idiomatic way (which is something I hate doing).


In my mind, this usage of parenthesis is less ambiguous. Parenthesis are used in C-like languages for both function calls and order of operations. That is to say, they are used in these two ways:

    foo(a, b, c)  // functions
    (a + b) * c   // order of operations
Making parenthesis optional for function calls means parenthesis are used instead for just controlling order of operations.

In practice, CoffeeScript can't always guess when something is a function call (such as a function call without arguments), so you end up mixing in some function call usage no matter what.


I really hope it isn't guessing anything...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: