Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

191–200 of 220 posts

Re: Announcing CoffeeScript 2

#191

Earlier quoted context omitted.

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.

It’s not elegant, but there is a way to do type checking in CoffeeScript: http://coffeescript.org/#type-annotations

This is cool! That being said, it would be very nice to have (optional) syntactically more beautiful type annotation. I assume Flow must be compatible with regular javascript, but CoffeeScript could take more flexible approach. I have no idea what the actual syntax could be, though.

Re: Announcing CoffeeScript 2

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

> That said, for a new development, is there any reason to use it over ES6?

Obviously your mileage may wary. I think, the biggest reason is a time boost.

- Less noisy code (no braces etc) that is easier to scan

- No time wasted on flirting with new ESXXXy stuff

- There is no callback hell to deal with

- Writing React code is sweet. As previously noted: http://rapin.com/blog/2015/02/03/reactjs-with-coffeescript/

- Less distractions on things that don't really matter in 98% of use cases. Like var/const/let declarations

Re: Announcing CoffeeScript 2

#193

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 friend that is using cs every day now was also using () around every function call back in the day. Now he doesn't. I think it is more of a preference that _changes_ over time. Just saying that you might like it the other way one day

Re: Announcing CoffeeScript 2

#194

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…

I think you might gain a lot from taking a closer look at CoffeeScript.

Re: Announcing CoffeeScript 2

#195

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…

Do you use any modern JS tools? Webpack? Require or import? Babel? In my experience any es6 tooling is much of a bigger pain compared to coffeescript tooling.

Re: Announcing CoffeeScript 2

#196
post #23

First congrats, this is hard-work. Second I implore people not to use a language where the designers think breaking changes are OK, while giving no real advantage over plain modern Javascript or the use of a linter. Worse, since CS has slighly different semantics than JS it will lead to so much confusion. Coffee Script served its purpose, now let it rest.

I switched my codebase from 1 to 2 and didn't notice a single syntax issue or a failed test. So not such a big "breaking" change after all.

Re: Announcing CoffeeScript 2

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

also `{` after a return without value

Re: Announcing CoffeeScript 2

#198
post #148

Earlier quoted context omitted.

I loved CoffeeScript, but I felt it was a double edged sword. I would still use it though, if there were JSX style xml/html tags. But React changed everything for me and as a full stack dev, I can use only few frameworks on one level. Edit: Ok, JSX is now supported. http://coffeescript.org/v2/#jsx And I'm glad they broke the different behaviour of =>. It might need a fix in a lot of code bases, but this price is chea…

I personally can't stand jsx, and coffeescript makes it so much nicer to avoid when using React. It's almost like haml / slim / jade / pug if you know what I mean. I wrote a comparison about it a couple years ago: http://rapin.com/blog/2015/02/03/reactjs-with-coffeescript/ I'm not doing much react these days ( cough elm), but I think it's still mostly relevant.

Yeah, Elm is the bomb! Had to grin when I saw your comment. I am really happy with this refactor of Coffeescript but Elm is what I do.

Re: Announcing CoffeeScript 2

#199
post #36

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?

link?

https://www.kickstarter.com/projects/michaelficarra/make-a-b...

Re: Announcing CoffeeScript 2

#200
post #189

Earlier quoted context omitted.

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.

Bingo. Remember when you first first learned the ternary operator syntax? I recall thinking something along the lines of, "Wow, that's cryptic!"

    result = if condition then success else failure
Post reply on HN