by Croaky on 1/30/15, 1:54 AM with 168 comments
by mrinterweb on 1/30/15, 3:26 AM
Many people don't like that CS needs to be compiled. I don't see this as an issue since pretty much every application I work on these days is concatenated and uglified. So adding a JS compiler is already part of most JS application's build process. 6to5 is being compiled to ES5 anyway. Also, if you include in your build pipeline a source mapper, debugging is not a problem.
by jashkenas on 1/30/15, 3:21 PM
CoffeeScript is a fun little experiment in what's possible when you take JavaScript semantics and try to boil down the user interface to a minimalist surface. But JavaScript will always keep on rolling onwards — and to the extent that future versions of JavaScript take any minor inspiration or reference or overlap with things that CoffeeScript already does, the more the better.
For example, see this talk from four (!) years ago: https://www.youtube.com/watch?v=QTj6Q_zV1yg
There's more than one way to skin the JavaScript cat.
In other news, CoffeeScript 1.9.0 came out yesterday — with support for ES6 generator functions. A-la Python, in CoffeeScript, a generator is simply a function that "yield"s.
by addisonj on 1/30/15, 2:49 AM
That said, I hope it slowly fades into the background as more people go back to vanilla ES6 or go with something more powerful such as TypeScript (or Flux). With the progress around es6 and es7, gradual typing, macros, and other tooling around the language, I think CoffeeScript risks becoming a drag on getting people to learn modern JS and instead sticking with a language that has a lot of ambiguous constructions and fewer and fewer advantages over JS.
by picardo on 1/30/15, 3:47 PM
But the future of CoffeeScript is bleak because many software designers are beginning to understand the value of type systems, e.g. TypeScript and Flow, for building maintainable Javascript code bases, and this means CoffeeScript is out of the picture for good because its long term design goal is to remain a minimalistic language, and doesn't intend to support these ideas. There have been attempts[0] to fork it to add a legitimate type system to it so it can scale, but they have faltered. Aside from that, the way CS deals with variable shadowing[1] makes it risky to use in large codebases.
So when ES6 syntax is tolerable and stable, I will pack my bags and move over to the ES6 land with great regret. I wish I could stay in CS land for longer, but you have to put away childish things eventually.
------------
[0] https://www.npmjs.com/package/typed-coffee-script
[1] http://stackoverflow.com/questions/15223430/why-is-coffeescr...
by zerker2000 on 1/30/15, 5:51 AM
it solves a lot of the problems that CoffeeScript is trying to solve without drastic syntax changes.
I cannot speak to authorial intent, but for me the majority of the problems CoffeeScript(and moreso LiveScript) solves are syntax ones.by abecedarius on 1/30/15, 3:04 AM
by albertoleal on 1/30/15, 3:02 AM
You can start using transforms that provide features other than ES6: https://6to5.org/docs/usage/transformers/
by sgslo on 1/30/15, 2:42 AM
by slimetree on 1/30/15, 7:22 AM
It seems better to treat JavaScript as admittedly not being the most powerful language in the world, and to treat the standard as a kind of RFC that only compiler writers have to think about. For most programmers it works to just use CoffeeScript (or Lisp or anything) without worrying about standards, just as JavaScript programmers don't need to worry about how their processor works.
by sebastianmck on 1/30/15, 3:36 AM
by meowface on 1/30/15, 2:41 AM
by lucaspiller on 1/30/15, 4:24 AM
by pjwal on 1/30/15, 12:41 PM
And yes, this can be said for almost any tool choice, but my spidey sense tells me the half life for CS is about that of something like Jira.
by msutherl on 1/30/15, 5:36 AM
by mikeryan on 1/30/15, 2:56 AM
ES5 has Function.bind
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
by risent on 1/30/15, 6:28 AM
by kin on 1/30/15, 4:39 PM
Also when working with external libraries and dependencies, I found myself resorting to trial and error figuring out the correct syntax because nearly all documentation is written in JS and not CS.
by shittyanalogy on 1/30/15, 4:33 AM
Classes:
There is no semicolon after the function name
The function keyword is omitted
There are no commas after each definition
Interpolation: `${1 + 1}` <- why not just # like everyone else?
Multi line strings: ` Now we have a 3rd
string delimiter`
Fat arrow: $("button").on("click", () => {
// really? hanging parens? no function keyword?
});
Destructuring: var [first, , last] = [1, 2, 3]
// thats a var to assign vals inside an array
// and just two commas touching to ignore a value
The whole post is about drastic syntax changes. The brackets are optional in coffeescript.Besides coffeescript is just a tool.
by someguy1233 on 1/31/15, 11:40 AM
TypeScript is pretty good at giving you a taste of ES6, it brings in a lot of features from ES6, such as the new classes, default arguments, generics, as well as a few of it's own features (interfaces, optional static type checking).
They ship it as a node module, so you can just "npm install -g typescript" and it's ready to go. As much as I dislike Microsoft, Typescript is something that seems to work well, and unlike Coffeescript, I can quite happily paste in standard Javascript code (even most ES6 code) and it won't break my source.
by nothrabannosir on 1/30/15, 5:41 AM
by jongraehl on 1/31/15, 5:20 PM
Short braceless code typesets beautifully, but you can probably get a similar effect w/ an appropriate 'braces highlight at lower contrast when autoindented as expected'.
by rtfeldman on 1/30/15, 6:05 PM
To replace one tool with another, you need a compelling reason...and "it's almost at feature parity" is not that.
by mhd on 1/30/15, 9:17 AM
Other than that, the braces/indentation issue alone will keep people with CS. Can its compiler emit ES6, by the way?
by amelius on 1/30/15, 11:27 AM
Unfortunately, they didn't solve this with ES6.
by mkolodny on 1/30/15, 3:04 AM
by ziahamza on 1/30/15, 7:51 AM
by tiglionabbit on 1/30/15, 9:09 AM
by quadratini on 1/30/15, 4:33 AM
by scotty79 on 1/30/15, 12:52 PM
Those features will be (or already are) ported to CoffeeScript.
And the CoffeeScript sugar is just tastier.
ES6 syntax is kind of CoffeeScript for people who hate meaningful indentination and it's quite decent for that purpose.
by gankgu on 1/30/15, 3:02 AM