Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

171–180 of 220 posts

Re: Announcing CoffeeScript 2

#171

Earlier quoted context omitted.

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?

I'm afraid you're a few years too late!

https://github.com/jiangmiao/toffee-script

Re: Announcing CoffeeScript 2

#172

Earlier quoted context omitted.

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, peop…

Ok, thanks.

I agree about { } being mostly noise but I think they are the lesser evil. I'm making most of my money with Python and I still believe significant whitespace is a very bad idea. The Ruby alternative of using end is better even if not super elegant (and Ruby is my language of choice). It's on par with curly braces. After 30+ years of programming I still have to find a satisfying solution to the problem.

Re: Announcing CoffeeScript 2

#173

Earlier quoted context omitted.

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 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…

I work with a 100% CS code base and lodash chains are a dream working in CS as opposed to vanilla JS, something like:

  capitalStringsWithX = _.chain array
    .map (item) -> item.toUpperCase()
    .filter (item) -> item.includes "X"
    .value()
as opposed to:

  var capitalStringsWithX = _.chain(array)
    .map(function(item) { return item.toUpperCase(); })
    .filter(function(item) { return item.includes("X"); })
    .value();

Re: Announcing CoffeeScript 2

#174
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 really wanted to like coffeescript, but the idea of compiling, transpiling or any other kind of piling of javascript just rubbed me the wrong way. this is true of scss, less and other css flavors too. i understand the problems these tools are trying to solve, but i don't like that you have to learn two (or more) grammars and syntaxes, and the quirky interactions between them, to get those benefits (because you can'…

> it's a lot more cognitive overhead for what amounts to a little syntactic sugar.

This isn't really accurate with respect to meta languages like SCSS that add new features not present in the underlying language, like variables.

You really are missing out on a lot by not using the meta languages.

Re: Announcing CoffeeScript 2

#175
post #2

The breaking changes page is ironically quite broken (latest chrome) http://coffeescript.org/#breaking-changes Edit: Seems that my computer doesn't consider the cert authority valid for bootstrapcdn.

Make sure your clock/date is correct on your system.

Re: Announcing CoffeeScript 2

#176

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…

I just started a new project and decided to go back to the indented Sass syntax as well. Makes a nice compliment with CoffeeScript, Halm, Slim, etc.

Re: Announcing CoffeeScript 2

#177
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 don't miss how "concise" it is. Concise syntax usually means "fun to write, hell to read".

It's not that ES6 is good enough; it's that CoffeeScript is actually "bad".

Re: Announcing CoffeeScript 2

#178
Huge thanks to CS2 team! Great to see CoffeeScript alive again and targeting ES6, making lot of easier to to choose it for new projects.

I never abandoned CS or converted existing codebases to ES6, as I feel that ES6 hasn't much to offer compared to CS, and you lose the elegant syntax, which was always the major selling point for me (former Pythonista).

CoffeeScript is closer what Javascript was originally meant to be, before Brendan Eich had to adopt Java-like syntax, a decision made by Sun marketing team.

Re: Announcing CoffeeScript 2

#179

Earlier quoted context omitted.

I consistently don't use semicolons in JS. It's just noise.

Omitting semicolons breaks the "delete a line in isolation" rule, unless you begin the line with a semicolon instead. Which is even noiser than just having them at the end of the line, where they are unconsciously glossed over by anyone who's ever worked in a language with C-derived syntax.

In the majority of cases you can't "delete a line in isolation", because it's part of a program. You have to look around and understand what the impact of deleting that line will be -- and modify nearby lines as necessary.

Re: Announcing CoffeeScript 2

#180
Is the language refrence at http://coffeescript.org/#language completely up to date with CoffeeScript 2 or only partially?

Edit:

http://coffeescript.org/#whats-new-in-coffeescript-2 answers this I think.

> The biggest change in CoffeeScript 2 is that now the CoffeeScript compiler produces modern JavaScript syntax (ES6, or ES2015 and later). [...] There are very few breaking changes from CoffeeScript 1.x to 2 [...]

So probably that means that the language reference is up to date.

Post reply on HN