Live data from Hacker News

Intro to CoffeeScript

aseemk.com

21–30 of 95 posts

Re: Intro to CoffeeScript

#22

Is CoffeeScript used much outside of Rails? If not, wouldn't it be a better idea to focus on mastering javascript so it applies globally?

I'm working on a Symfony/CoffeeScript/AngularJS/Bootstrap3 project right now. Haven't tried Ruby or Rails yet.

Re: Intro to CoffeeScript

#23
post #5

> The explanation for most people’s dislike of CoffeeScript is probably our natural resistance to new things and our comfort in what we know. This is a mildly insulting, as is the invocation of Blub. CoffeeScript doesn't have a ton of exotic features. String interpolation, list comprehensions, and class definitions (!) are all familiar to programmers from other languages. I'm guessing that a lot of people have weighe…

I've written my fair share of coffeescript and right now I'm working on a large node/angular project and I'm glad we stuck with Javascript. I definitely miss some of coffeescript's features and having cute, ruby/python-ish looking code, but at the end of the day, it's another dependency that can easily be circumvented.

Re: Intro to CoffeeScript

#24

I stopped using CS because it's going to have some issues when ES6 becomes more of a real thing. For instance, how is CS going to handle for/of loops when ES6 has it's own for/of loops that is slightly different. The same goes for class and super. There will have to be CS2 that introduces new semantics and old apps will have to be migrated.

>There will have to be CS2 that introduces new semantics and old apps will have to be migrated. I'm sure there will be a new version of CS when ES6 becomes widespread, but why would old apps need migrating? CS produces regular JS, and thus will be 100% compatible with ES6.

Actually coffee's js is currently compatible down to IE6, which the author said is what he wants to support at this point. So unless MS were planning to backport ES6 compatible JavaScript to the dead IE6, CoffeeScript supporting ES6 will either change/break at some point or become a unreasonable backward-compatibility clusterfuck (probably the former). ES6 becomes official in late 2014 so there is probably enough time for a lot of changes to happen.

Re: Intro to CoffeeScript

#25
> What I find sad, though, is that most people who dislike CoffeeScript don’t truly know it. They haven’t taken the time to really learn it, or even try it. Their reactions are usually knee-jerk, or based on fallacies. [...] The explanation for most people’s dislike of CoffeeScript is probably our natural resistance to new things and our comfort in what we know.

Oh, wow. I've been using CoffeeScript for about a year for the usual front-end crap, not long ago I re-evaluated Coffee for the second time before starting a full-JS project and certainly won't use it. While I'm a fan of bracketless whitespace significant langs (Python, Sass, Haml) CS's is just bonkers and you never know when a single space will bite you by compiling to a completely different code you had in mind. The ecosystem is weak not to say non-existent comparing to JS, and every JS solution and example out there from minor jquery stuff through SPA frameworks to mobile UI builders is in, well, JS (duh!), so public code reusability becomes a ridiculous task of converting to CS, only to compile it to JS once again. I still use CoffeeScript for small front-end work, meanwhile for any bigger work I find CS an obstacle over JS, and an unnecessary step between my idea and working code; especially when the JS ecosystem has grown a lot of tools to help you deal with what pisses you off (underscore/lodash as an example come to mind).

And from the slide:

> And as of July 2013, it's also the tenth most popular language on GitHub! That's more than Objective-C, ActionScript, C#, Clojure, Go, Groovy, Scala

Yay github charts as evidence of industry value.

Knee-jerk, fallacies, resistance? Call it what you want and good luck. Meanwhile, I will use coffee to keep me awake, not to write apps with.

//edit: care to explain the downvote?

Re: Intro to CoffeeScript

#26

I stopped using CS because it's going to have some issues when ES6 becomes more of a real thing. For instance, how is CS going to handle for/of loops when ES6 has it's own for/of loops that is slightly different. The same goes for class and super. There will have to be CS2 that introduces new semantics and old apps will have to be migrated.

This issue was actually raised a couple weeks ago here on HN and Jeremy responded thusly: https://news.ycombinator.com/item?id=6079709

Re: Intro to CoffeeScript

#27
I mostly enjoyed the slides, and I'm interested in CoffeeScript, especially since I'm going to be working a little in Node in the near future. This post is a critique on the blog post, rather than on the slide content, which was more or less fine.

Too much focus placed on how those who dislike it haven't given it a proper shot. This could be true, but six paragraphs is overkill. You make a few points: A) they aren't being open-minded enough, B) they are the typical blub programmer, and C) they shouldn't feel bad because it's perfectly understandable to do something so mundane. Had I been someone who had spent a few hours toying with CS and left unconvinced, you'd have lost me pretty quickly.

You mention that you hated it too, at first, but not early enough. I'd submit that you're far more likely to lose readership than to open eyes with this method.

Also, as someone who isn't particularly set against CS, I didn't enjoy reading so much about how I shouldn't feel bad for hating CS at first sight. I didn't.

Re: Intro to CoffeeScript

#29
post #18

This is a fantastic slide deck. The per slide comments below are great too. Particularly on an iPhone as you read them simultaneously. We've been using CoffeeScript for a bit over a year now and never looked back. All of our front end code is written in CS and I can't imagine writing JS again. It's just objectively better. Less code to write, easier to read, minimal cruft, and a joy to use. The only hiccup was gettin…

Thanks for the compliment! The viewer doesn't quite look and feel right on the iPhone, but glad you didn't think so. =)

I don't know what your stack is, but FYI on Node we use Connect/Express middleware that automatically compiles CoffeeScript files to JS -- and in production, caches the results -- before serving them. No manual building/compiling/packaging needed at any point. You might find something similar for your stack if you haven't already looked:

https://github.com/jashkenas/coffee-script/wiki/Web-framewor...

Re: Intro to CoffeeScript

#30
post #25

> What I find sad, though, is that most people who dislike CoffeeScript don’t truly know it. They haven’t taken the time to really learn it, or even try it. Their reactions are usually knee-jerk, or based on fallacies. [...] The explanation for most people’s dislike of CoffeeScript is probably our natural resistance to new things and our comfort in what we know. Oh, wow. I've been using CoffeeScript for about a year…

(I didn't downvote you.)

It's great that you tried CoffeeScript and prefer JS. Your opinion is well-formed.

With my statement, I was referring to the many developers I've encountered who haven't tried it, yet actively dislike it and argue against it. Hence the (subjective) "most" in my first sentence that you quote.

Cheers.

Post reply on HN