News for hackers. Stuff that matters.
Re:CoffeeScript: less typing, bad readability by jashkenas on Monday September 17, 2012 @11:18PM (#4536118)
I'm afraid that in conjunction with significant whitespace, they're not at all gratuitous. For example:

    describe 'Calculator', ->

      it 'can add two positive numbers', ->
        result = calculator.add 2, 3
        assert result is 5

      it 'can handle negative number addition', ->
        result = calculator.add -10, 5
        assert result is -5 
Mandatory parentheses make significant whitespace lose much of its appeal when passing a block construct into a function. This is a large part of the reason why Python limits lambdas to a single line...
Re:CoffeeScript: less typing, bad readability by masklinn on Tuesday September 18, 2012 @02:15AM (#4536641)
> This is a large part of the reason why Python limits lambdas to a single line...

Python doesn't limit lambdas to a single line, but to a single expression. That is a rather different constraint.

Re:CoffeeScript: less typing, bad readability by jashkenas on Tuesday September 18, 2012 @08:40AM (#4537631)
Sorry for the imprecision. It's the same thing to Python, in terms of significant whitespace. Language features that use whitespace for structure are not considered to be expressions, and can't be used as part of a larger computation. In CoffeeScript, they are, and can.
Re:CoffeeScript: less typing, bad readability by orangecat on Monday September 17, 2012 @11:35PM (#4536177)
Valid point. Although I'm on the fence about significant whitespace in CS as well; I value fixing JavaScript's glaring flaws much more highly than arguably more convenient but unproven syntax. (The boundary is admittedly fuzzy, e.g. list comprehensions).
Re:CoffeeScript: less typing, bad readability by politician on Tuesday September 18, 2012 @01:00AM (#4536418)
Optional parentheses wouldn't be so irritating if the rules for omitting them were universal. Currently, when calling functions with arguments you can omit the syntax, but when calling functions without arguments you must use parentheses. Could the 'dispatch vs variable reference' question be decided with some sort of suffix that preserves the value of whitespace? Something like 'f!' 'g! arg1, arg2'?