Skip to content

Comment on New Rails-like Framework from 37signals for HTML5 Mobile Apps

Comments

Ah, Coffeescript, the Ratfor of a new generation…

There is a need for Coffeescript; programming Javascript directly leads to cross-browser issues. Something like Coffeescript can abstract away the per-browser style issues. (The main annoyance I notice is the behavior of trailing commas in lists. In Firefox, it works. In IE, it silently breaks. Coffeescript avoids this issue, since the code you type never sees the browser.)

I would personally find a Javascript->Javascript compiler more compelling, as it would mean I wouldn't need a new editor toolchain. But that wouldn't be as fun to blog about, becuase you would still have to type $("DOM") instead of $ DOM!

Wasn't abstracting the differences between different Fortran compilers part of the raison d'etre of Ratfor, too?

It's mildly annoying. Unlike Fortran, JS doesn't desperately need a preprocessor language. Adding another layer of "abstraction" and some syntactic sugar will make the process of developing good JS needlessly complex and fragile.

So "it turns out"[1] that Coffescript will make the process of developing good JS needlessly complex and fragile.

Would you care to elaborate?

From the coffeescript site :

> it compiles into clean JavaScript (the good parts) that can use existing JavaScript libraries seamlessly, and passes through JSLint without warnings. The compiled output is pretty-printed and quite readable.

[1]http://jsomers.net/blog/it-turns-out

When I used it, it cut ~25% of the LoC off my project. And it only took about an hour to learn because the documentation is so damn good. On the usefulness scale, I'd put it next to jQuery and backbone.js.

Googling around for Ratfor doesn't reveal the history -- mind sharing what happened with Ratfor in the end? From your tone, I'm assuming it ended in tears...

It was more a "plus ca change" thought, I actually liked the idea of CoffeeScript, although for my personal work I came to the conclusion that it's not that necessary.

Ratfor itself was mostly a stop-gap solution. Fortran 77 made things a bit easier, and a quite a few developers migrated to C.

I'm actually surprised that there aren't more preprocessors like CoffeeScript. Yes, there are a few languages that compile to JavaScript, but most of them don't aim for ease of integration of existing libraries. So it's just you, your language and the DOM. And if it's just there to supplement your usual backend language (Lisp, Java etc.), you probably don't care that much about node.js.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.