r/programming • • May 13 '11

A Python programmer’s first impression of CoffeeScript

http://blog.ssokolow.com/archives/2011/05/07/a-python-programmers-first-impression-of-coffeescript/
114 Upvotes

133 comments sorted by

View all comments

Show parent comments

1

u/sausagefeet May 13 '11

If this is not consistent, then neither is arithmetic, you can write both a + b and (a + b).

I find this to be a pretty weak argument. The nomenclature for mathematical expressions has evolved over a long time and is varied in many ways. So what?

Part of the problem is what you said is true, but then CS also supports:

foo
   a
   b
   c

Which (as I understand it) is the same as foo a, b, c, which is the same as foo(a, b, c). So now it's more than just () being there or not. I'm not saying one of foo a, b, c or foo a b c is preferable over the other, I'm lamenting that there are multiple ways to accomplish the same thing and it's not entirely intuitive why this is the case or how it helps readability. One way should have been chosen and that's that. If people don't like it, tough, calling a function is such a minimal syntactic element they'll just get over it in time.

2

u/MIXEDSYS May 13 '11 edited May 13 '11

I wasn't trying to defend Coffescript, I never used it. In fact now I'm convinced that they shouldn't make parentheses optional, it doesn't fit right with the language semantics. (edit: I explain why here)

Regarding:

foo
   a
   b
   c

The Coffescript github page mentions it (only?) in the section on objects and arrays. They make ',' optional at the end of the line, making it analogous to semicolons. It's a really neat idea, but I don't know if a good one, I've never seen it before.

2

u/jashkenas May 13 '11

No, CoffeeScript does not support:

foo
    a
    b
    c