Live data from Hacker News

Intro to CoffeeScript

aseemk.com

31–40 of 95 posts

Re: Intro to CoffeeScript

#31
post #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…

Thanks for the great feedback. I think you're totally right.

I didn't intend to come across as so preachy in my post. I was just writing freely without (too) much worry.

Live and learn. =)

Re: Intro to CoffeeScript

#32
It would have been great if he had mentioned IcedCoffeeScript at some point too. Coffeescript by itself is 'ok' but IcedCoffeScript - at least on the serverside - is fantastic.

Re: Intro to CoffeeScript

#33
post #32

It would have been great if he had mentioned IcedCoffeeScript at some point too. Coffeescript by itself is 'ok' but IcedCoffeScript - at least on the serverside - is fantastic.

Indeed! I have much respect for Max and company. We use and love Streamline.js ourselves -- works great with CoffeeScript.

https://github.com/Sage/streamlinejs

I'd love to talk on or write about Streamline at some point too.

Re: Intro to CoffeeScript

#34
post #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 yo…

There was some slight formatting issues but overall it worked well. It's nice to have the additional context/detail with the slides kind of like what you'd get if someone presented it live.

The node.js side project is a RESTful API so all the CS is server code (no front end CS or JS). It all builds automatically and no special config there. I started if off using a stripped down version of the template I linked to above (though removing mongoose and using node-postgres async instead).

The custom build process is for out main app JackDB[1]. It's written in Java and it's a combination of taglibs and a build script. We have a check in there for dev/prod to decide whether to serve precompiled JS files or the original CS files (if its local dev). We did it this way so it fits into our nginx caching setup which marks all static assets as permanently cached (max-age + public). The build process also prefixes the resources with the git revision so each new build forces the client to get the latest and greatest.

[1]: http://www.jackdb.com/

Re: Intro to CoffeeScript

#35
post #24

Earlier quoted context omitted.

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

Are you saying the current JS loops will stop working at that point? Of course not. So why would it matter? CoffeeScript -> Javascript will continue to work like it always did.

Re: Intro to CoffeeScript

#36
post #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.

(I know, OPs can't downvote direct comments)

You're right that people should try out stuff before criticising, and in general I support the notion; yet I fully understand people who don't want to jump ship onto very new things because leaving a well-established environment for an immature/unstable one can (but doesn't have to) be a risk. At least Coffee is relatively easy to leave - just take your compiled code and get rid of the source.

I'd also like to add for the rest: what convinced me to try Coffee was @jsjabber podcast with the author http://javascriptjabber.com/017-jsj-coffeescript-with-jeremy... - I think it explains the concepts pretty well (I recommend the whole podcast btw, it's great) and I encourage to listen to it if somebody is curious and wants to try out.

Re: Intro to CoffeeScript

#37
post #35
post #24

Earlier quoted context omitted.

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

Are you saying the current JS loops will stop working at that point? Of course not. So why would it matter? CoffeeScript -> Javascript will continue to work like it always did.

current js loops for sure will not, but I guess maintaining full backward compatibility would be a hard task, so I assume at some point CS will evolve to support only the newer standards. ie6 compatibility it's something jeremy talks about in the podcast I linked in the other comment here.

Re: Intro to CoffeeScript

#38
post #31
post #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…

Thanks for the great feedback. I think you're totally right. I didn't intend to come across as so preachy in my post. I was just writing freely without (too) much worry. Live and learn. =)

I can't fault you for that, and I could probably learn a thing or two from writing more freely.

Re: Intro to CoffeeScript

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

So far, I thought CoffeeScript as something neat to use. After going through the slides, I now think it is not worth it for a mildly seasoned javascript programmer. I can see how it could help a newcomer to avoid javascript pitfalls, but those pitfalls could also be covered with a few commandments to follow.

Re: Intro to CoffeeScript

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

What overhead? If you mean performance, there's actually basically no runtime performance overhead in most cases. In fact, if you use CoffeeScript's "for" loops have a performance advantage over JavaScript Array's map()/forEach() methods.

I used to have a similar opinion but was forced to use CoffeeScript on a project and haven't looked back.

Post reply on HN