Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

181–190 of 220 posts

Re: Announcing CoffeeScript 2

#181
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'…

> the idea of compiling, transpiling or any other kind of piling of javascript just rubbed me the wrong way.

Well, this is how a lot of JS (if not most) is done today anyway.

Re: Announcing CoffeeScript 2

#183

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 felt the same way when I switched from CoffeeScript to TypeScript but the type checking was worth all the braces, returns and lack of existential operator. If CoffeeScript added an (optional) type system I'd switch back in an instant.

You might like LightScript: http://lightscript.org

Good interop with Flow isn't quite there yet, though.

Re: Announcing CoffeeScript 2

#184

I'd happily go back to CoffeeScript if I could keep using Flow/TS/ESLint and the rest of my toolset. That's entirely possible, and the setup would look like this: CS would produce a babel-compatible AST, instead of producing the final ES6 source code. It would simply leave the job of generating the final code to babel (via babel-generator). You'd then be able to re-use some (though not all) of babel plugins on top of…

You might like Lightscript: http://www.lightscript.org/

Re: Announcing CoffeeScript 2

#185
post #72

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…

> 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 `;`.

There's more than just those edge-cases, but the others are rare in practice. They include +, -, `, There's also some odd ASI issues within class bodies.

https://github.com/prettier/prettier/pull/1129 can be a useful reference (and tool!)

Re: Announcing CoffeeScript 2

#187
I think this is great! It allows people using an existing coffeescript code base to transpile to the latest ES.

My question is: Why would you adopt coffeescript in a new project?

Re: Announcing CoffeeScript 2

#188

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

My style guides to avoid this:

- Only use {}-free object literals in assignment

- Always add () to nested single-line function calls, and calls with expressions.

Re: Announcing CoffeeScript 2

#189
post #68

Earlier quoted context omitted.

i also don't use CoffeeScript because of any 'feature' it has over standard JS but instead because of its concise but expressive syntax. it's less about what it does have/do, and more about what it doesn't have/do. some small aspects of CS i forgo because they (in my opinion) are a little too concise such that they sacrifice readability, but all in all it has my favorite syntax of any language.

CS breaks the ternary ?: operator which is a big headache for me.

Everything is an expression. Including if statements. There is no need of such syntax abominations.

Re: Announcing CoffeeScript 2

#190

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…

IMO Python is way easier to read though..

  def foo(bar):
    a = bar + 1

  vs

  foo = (bar) ->
    a = bar + 1
Post reply on HN