News for hackers. Stuff that matters.
Re:This is CoffeeScript by tlrobinson on Monday August 22, 2011 @03:35PM (#2913753)
Am I the only one who thinks this is horribly difficult to visually scan?

    item = new Item title: "Awesome", id: 2
Less isn't always better. I like the parens, at least if there's more than one argument.

    item = new Item(title: "Awesome", id: 2)
It's much easier for me to glance at this and know what's going on.
Re:This is CoffeeScript by qrush on Monday August 22, 2011 @03:51PM (#2913823)
Re:This is CoffeeScript by mgutz on Tuesday August 23, 2011 @10:08AM (#2916583)
Love CoffeeScript, but yeah omitting parens makes it hard to read in this case. I follow Visual Basic convention. Use parentheses when using the return value. In this case, the constructor function returns an object. Omit parentheses otherwise, i.e. using a function as a method (no return value).
Re:This is CoffeeScript by Cushman on Tuesday August 23, 2011 @04:45PM (#2918294)
All I can say is you get used to it, and it encourages you to write in shorter sentences, which results in more readable code overall.
Re:This is CoffeeScript by jrockway on Monday August 22, 2011 @03:45PM (#2913794)
What else would it mean?
Re:This is CoffeeScript by tlrobinson on Monday August 22, 2011 @03:54PM (#2913842)
I can understand what it means, it just takes slightly longer to comprehend without the parens providing a visual cue that it's a function call.

It only gets worse with nested function calls:

    item = new Item title: new Title "Awesome", id: 2
The syntax isn't ambiguous, but that doesn't mean it's easy for humans to parse.
Re:This is CoffeeScript by jessedhillon on Monday August 22, 2011 @05:28PM (#2914207)
In a language where there are two drastically differing ways to express the same idea, it could mean anything.
Re:This is CoffeeScript by jrockway on Monday August 22, 2011 @06:35PM (#2914434)
How are we having this conversation in English, then?
Re:This is CoffeeScript by jessedhillon on Tuesday August 23, 2011 @02:43AM (#2915627)
Well, it took about 8-12 years of practice for me to be able to do it correctly, and at least twice that to achieve my current proficiency. So when I have my choice of designed languages, I'd like one that tries to learn from the failings of the organic ones.
Re:This is CoffeeScript by rikthevik on Monday August 22, 2011 @11:13PM (#2915184)
It could easily mean that item is a 2-tuple.

item = (new Item title: "Awesome", id: 2)