Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

161–170 of 220 posts

Re: Announcing CoffeeScript 2

#161

So great to see a good release after all these years. Congratulations to all! I'm curious though about what happened to the Kickstarter project that took a few grand to write what was to be "CoffeeScript 2" at the time - did any of that code end up in this release?

It didn't. Although Geoffrey and folks considered a rewrite of the compiler along the lines of Michael Ficarra's CoffeeScriptRedux, they decided it was more pragmatic just to work with the existing compiler and get it to produce Modern JS instead of the Lowest-Common-Denominator JS it previously output. A wise choice, especially given 2017 interest and energy levels. Edit: To be clear, to the extent anything can or c…

Agreed, getting this upgrade out the door in 2 months is a monumental achievement and I can't imagine a full rewrite happening at anything close to that pace. I'll be happily hacking away with CoffeeScript 2 + Crystal this weekend! Thanks for being awesome :)

Re: Announcing CoffeeScript 2

#162
post #134
post #10

I can't imagine CoffeeScript will see much adoption these days as most people seem to think ES6+ is "good enough". I miss how concise functions are in CoffeeScript and also miss being able to do object literals without the braces. But there's no chance at all in convincing my team to adopt it, as modern JS really is "good enough".

I honestly think both ES6, Coffee and the like are going in the absolute wrong direction. Every release replaces more keywords with punctuation marks. That's the reason the community abandoned Perl. How much productivity do I gain by replacing "function()" with "() =>"? Round and round we go. Before anyone tells me, yes I know the semantics are slightly different, but muddling the semantics with arcane syntax is not…

I’m going to tell you anyways :-D. function() { ... }.bind(this) is the correct comparison to () => { ... }, which is not only a productivity gain but a readability gain.

Re: Announcing CoffeeScript 2

#163
post #97

As much as I love CoffeeScript (because I love Python), I think over time the project is loosing it's value due to ES6 (Frankly I believe even TypeScript is going to suffer the same plague soon). One possible incentive for me might be the toolkit and the pre-built stuff that I can get out of box from such transpilers (JSX is a good addition for example, however I am surprised why something like PUG, or HAML was not a…

For what it's worth, Earl Grey has a more lightweight syntax to build HTML, advanced pattern matching, and looks more like Python: http://www.earl-grey.io/ (Disclaimer: I made this).

You just read my mind... makes me wonder why is this project so underrated. Will try it out for compile speed and stability.

Re: Announcing CoffeeScript 2

#164
post #103

I respect CoffeeScript for what it did and playing a part in making Javascript and its ecosystem better. That said, for a new development, is there any reason to use it over ES6? If you don't like the current Javascript, Cofeescript isn't going to convince you (Elm, Purescript, Scala.JS etc. might). The only direct value is see in this version is as an upgrade target for existing codebases.

> an upgrade target for existing codebases

That might be a little naive. I pick Coffeescript in a reflex without even considering ESxx, and I regularly start new projects large and small with it that go into production. It's a breeze compared to some of the modern Javascript codebases I have to work on. My overall development speed is definitely faster in Coffeescript, less bugs, no countless babel add-ons, no linters etc.. and the codebase often speaks for itself, less annotations, less code. Efficiency means a lot to me.

Re: Announcing CoffeeScript 2

#165

Earlier quoted context omitted.

That would be really nice, but CoffeeScript will probably not be adding types unless they start adding them to JavaScript. It is a dilemma, but so far I have gotten by without type-checking.

Well, guess it's time for someone to build yet another layer of abstraction by writing a typed superset that compiles-to-CoffeeScript then! (I'm joking, but actually.. why not?)

call it ToffeeScript - a dialect of CoffeeScript that transpiles to TypeScript?

Re: Announcing CoffeeScript 2

#166
I love Coffeescript. Even with ES6+ around, I ALWAYS used coffeescript when I work on projects. Because, my end goal is a business user who cares if his software functions correctly or not, not whether my stack consists of bleeding edge.

It's easy to oversee the benefits of CoffeeScript - "It just has a nice looking syntax", but in reality, it saves me a ton of time, not having to type all those braces. I'm a Ruby guy, it's really the difference between Ruby and PHP for me.

This is perhaps one of the best news items I woke up to.

Re: Announcing CoffeeScript 2

#167
post #72

Earlier quoted context omitted.

> cannot imagine going back to semicolons Actually, Javascript does not require semicolons to be present. If you skip them, the only edge-case is when you try to start your line with `[` or `(`. In that case, you can prefix the line with `;`.

I like consistency. And I am paranoid. When I write JS, I always include semicolons. When I write CS, it is a non-issue.

It must be said though that CS has its own headscratchers in terms of parsing, if you choose to leave off all optional punctuation.

Re: Announcing CoffeeScript 2

#168
post #76
post #51

Earlier quoted context omitted.

> implicit returns In my experience it has only been a problem when porting existing code bases. We only had to be a bit careful putting a return after a for loop at the end of a function so it doesn't build a list unnecessarily (otherwise implicit returns of unused random values don't hurt). For clarity, one of the few rules we have is to use return explicitly when a function is more than a single expression. > obje…

some colleagues of mine have complained about the significant whitespace being difficult to understand. i can't argue with something subjective like that. however i like to point that our entire codebase, CS, JS, TS, Python, Java, Swift, 100% of it already has significant whitespace. ...it's just that the JS/TS/Java also have curly brackets.

I'm not sure I understood. I don't know about Swift but do JS and Java have significant whitespace?

Re: Announcing CoffeeScript 2

#169

This is honestly the first time I have looked close at CoffeeScript. At a passing glance, it looks really close to Python with javascript elements added in. Is that a correct assessment? If it is, this might be for me. My other question is: how nice does coffee script play with other libraries? We (unfortunately) use jQuery a lot. I have also been using underscore and lodash as well. Are those two even needed when wr…

If you like Python, you will love CoffeeScript. :) I have not used Underscore/Lodash in production, but I use jQuery a lot with CoffeeScript. CoffeeScript does not replace jQuery, although it can make your jQuery a lot nicer. As far as other libraries, there really are no restrictions; CoffeeScript compiles transparently to JavaScript. The only thing holding it back would be poor support in the specific ecosystem you…

I love Python, but I always found CoffeeScript took Python's stylistic choices too far. Making {} around object literals and () after function calls optional led to code that was very difficult to visually parse.

Re: Announcing CoffeeScript 2

#170
post #76

Earlier quoted context omitted.

some colleagues of mine have complained about the significant whitespace being difficult to understand. i can't argue with something subjective like that. however i like to point that our entire codebase, CS, JS, TS, Python, Java, Swift, 100% of it already has significant whitespace. ...it's just that the JS/TS/Java also have curly brackets.

I'm not sure I understood. I don't know about Swift but do JS and Java have significant whitespace?

No, twykke is saying that in almost every language, even ones that don't technically have significant whitespace, people still use coding conventions and style guides that restrict whitespace to match the curly braces. Some people even use automated commit hooks to reject commits that don't follow the guide.

The end result (or arguably, driving force) is that even in languages where whitespace isn't significant, people read the whitespace, not the curly braces. So the curly braces are basically redundant noise.

Post reply on HN