3 ms·
The war on curlies is over, curlies lost. Good to see new languages improving upon syntax, readability is key and a great way to gain adoption. As Norvig said,
by Kilimanjaro 16y ago
The war on curlies is over, curlies lost.
Good to see new languages improving upon syntax, readability is key and a great way to gain adoption. As Norvig said, it is easier for him to explain an algorithm in python than any other language. Well, now CoffeeScript has just passed that test too.
Brendan Eich is also adapting many good things from CoffeeScript to JS.next, validating the point that coffee, in its short life, has been able to influence other great language designers.
And that says a lot about CoffeeScript and its potential.
- jashkenas 16y agoI agree. If nothing else, CoffeeScript will be a success if some of its ideas find their way into a future version of JavaScript. It's been very gratifying to see folks like Crockford and Eich giving it a serious look: * http://intertwingly.net/blog/2010/11/25/Hobgoblin-of-Little-Minds http://intertwingly.net/blog/2010/11/25/Hobgoblin-of-Little-... * http://brendaneich.com/2010/11/paren-free/ http://brendaneich.com/2010/11/paren-free/ * http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-5 http://developer.yahoo.com/yui/theater/video.php?v=crockonjs...
- m0nastic 16y agoI just wanted to point out that the first link you posted had a great discussion in the comments.
- pyrotechnique 16y agoMuch like this discussion ^w^
- jamesbritt 16y agoThe page says, "Objects may be created using indentation instead of explicit braces, similar to YAML. " Similar to YAML? What exactly does that mean? Is there someplace that explains the specific indentation rules? The indentation rules of YAML are massively borked; it's not enough that something be indented, it has to be indented a very specific number of spaces. As opposed to, say, Haskell's more sane off-side rules.
- jashkenas 16y agoCoffeeScript isn't particular about the specific number of spaces, as long as you're consistent. For example: book.save title: "The Book of the Thousand Nights and One Night" length: 45 chapters: "The Fisherman and the Jinni": 1 "The Tale Of The Ensorceled Prince": 13 "The First Kalandar's Tale": 27 Compiles into this JavaScript: book.save({ title: "The Book of the Thousand Nights and One Night", length: 45, chapters: { "The Fisherman and the Jinni": 1, "The Tale Of The Ensorceled Prince": 13, "The First Kalandar's Tale": 27 } });
- TomasSedovic 16y agoI'm afraid that's not correct. You can use arbitrary number of spaces to indent a block in YAML[1]. It does't matter if it's 2 of 4 or 17. The only limitations are that it must be greater than the indentation of the parent node (obviously), that all siblings must have the same indentation and that tabs are not allowed. Are you sure you're not mistaking this with HAML? It's a bit stricter with the indentation requirements. [1]: http://www.yaml.org/spec/1.2/spec.html#id2777534 http://www.yaml.org/spec/1.2/spec.html#id2777534
- jamesbritt 16y ago"I'm afraid that's not correct. You can use arbitrary number of spaces to indent a block in YAML[1]." Well, shit. Thanks; how did I miss that? "Are you sure you're not mistaking this with HAML? It's a bit stricter with the indentation requirements." Oh, that I know. One reason I avoid it.