Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

131–140 of 220 posts

Re: Announcing CoffeeScript 2

#131

CoffeeScript is still very relevant for me. I have two medium-sized Ember projects written in CoffeeScript (and Emblem and Sass--the original, indented variety, thank you very much). I have been looking at React (will probably skip due to the patent license) and Vue, but cannot imagine going back to semicolons and (excessive) curly braces and parens. If you married CoffeeScript just out of convenience (being able to…

With Vue.js you can use Coffeescript (alongside others) as well as SCSS, Pug, etc in single file components using lang="coffee" attribute in the script (or style or template for the others) tag. Need to add a couple more dependencies to your package.json but it works like a charm.

https://vuejs.org/v2/guide/single-file-components.html

Re: Announcing CoffeeScript 2

#133
At work we started node with node 0.6, CS was nice at the time, it would bring cool stuffs such as arrow functions. Nowadays we are using Typescript, and we love it. To be honest, I am quite happy we are getting rid of CS, the lake of variable declaration specific syntax (as opposed to assignment statements) is really a big bug of the language IMO which can lead to really awful bugs in your code if you are not careful. We have been using https://github.com/decaffeinate/decaffeinate to help getting rid of our CS files, it works quite well.

Re: Announcing CoffeeScript 2

#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 an optimal solution.

Re: Announcing CoffeeScript 2

#135

Earlier quoted context omitted.

I figured jQuery would be fine. Now that I think about it, I can't imagine why most things wouldn't really, since all javascript libraries are just extensions of those things. Does CoffeeScript just convert the modules methods/functions accordingly when needing to be called? Just curious how that works. Since so much of JavaScript development, especially nowadays, ties into a lot of frameworks/libraries (modules? I'm…

CoffeeScript does not do anything framework- or library-specific. It simply compiles your code to JavaScript, which is then parsed and executed as usual.

Good point. I guess I'm not making myself clear. If I'm working with jQuery, for instance, do I need to do anything different than I do now in terms of invoking say, the simplest thing, $(function({_..code here.._}) (or for you old schoolers $document.ready({_..code here.._}). Thats what I guess I mean. Maybe I just need to toy with it. I suspect I might be overthinking this in my head.

Re: Announcing CoffeeScript 2

#136
post #46

As a CoffeeScript fan things were looking pretty bleak a year or two ago. In particular there was zero momentum for new features. How things have changed! Major kudos to Geoffrey Booth and all involved. Coffee's beautiful syntax combined with async/await has taken a lot of the 'ick' away from coding in JS, at least for me.

Exactly. I'm glad to see people arent absolutely shitting on it here like they have been over the past year or two, which is when I started using it,

Re: Announcing CoffeeScript 2

#137

Earlier quoted context omitted.

CoffeeScript does not do anything framework- or library-specific. It simply compiles your code to JavaScript, which is then parsed and executed as usual.

Good point. I guess I'm not making myself clear. If I'm working with jQuery, for instance, do I need to do anything different than I do now in terms of invoking say, the simplest thing, $(function({_..code here.._}) (or for you old schoolers $document.ready({_..code here.._}). Thats what I guess I mean. Maybe I just need to toy with it. I suspect I might be overthinking this in my head.

Its actually a great example of Coffeesctipt conciseness, the jQuery ready function is just $ ->

Re: Announcing CoffeeScript 2

#138
post #62

TypeScript still seems the much better choice.

I wish someone could take the best parts of TypeScript and CoffeeScript and put them together.

I think its likely that at some point in the future cs will get strong type support. Iirc the creator is opposed to it but theres interest from others.

Re: Announcing CoffeeScript 2

#139

Earlier quoted context omitted.

CoffeeScript does not do anything framework- or library-specific. It simply compiles your code to JavaScript, which is then parsed and executed as usual.

Good point. I guess I'm not making myself clear. If I'm working with jQuery, for instance, do I need to do anything different than I do now in terms of invoking say, the simplest thing, $(function({_..code here.._}) (or for you old schoolers $document.ready({_..code here.._}). Thats what I guess I mean. Maybe I just need to toy with it. I suspect I might be overthinking this in my head.

Yeah, play around with the online compiler on the website.

Your jQuery example would simply be written:

$ -> _..code here.._

Re: Announcing CoffeeScript 2

#140

I never understood the need for CoffeeScript. I especially don't understand why someone would want it now. Compilation of JavaScript is a terrible idea. I have worked with loads of different compile to JS languages. The compile step is a huge pain. The language has to be much much much better than JS for it to be worthwhile. I think that even JSX or TypeScript don't cut it... Close but still not worth the hassle! I u…

I found using the coffeescript loader for webpack solves all these problems. You cant execute cs in the browser but you still can place breakpoints in the original code. The compilation to js is not novel anyway, its the same thing as we see with ESnext just on a bigger scale.
Post reply on HN