4 ms·
Rails has a history of doing things with JavaScript that many developers disagree with. RJS is a prime example, where you would write Ruby code that generated J
by augustl 16y ago
Rails has a history of doing things with JavaScript that many developers disagree with. RJS is a prime example, where you would write Ruby code that generated JavaScript that assumed you used the Prototype.JS framework. And it wasn't until Rails 3.0 we got view helpers that didn't inline JavaScript.
So in my opinion we had one minor version with JavaScript I could relate to, and now we're back to where we were. But I don't mind, I'll just avoid using it.
- dasil003 16y agoYeah RJS was a clusterfuck, but hindsight is always 20/20. At the time it was a new idea that was being explored that just didn't pan out. The Prototype dependency dates back to 2004 when no framework had AJAX support, and the code just started getting stale from there and didn't get any attention until Rails 3. Anyway, I agree that Rails core has traditionally been far from the savviest of JavaScript developers, but the nice thing about Rails 3 is that they've finally achieved reasonable modularity with all the components, so there's not much pain in getting around Rails opinions anymore. As for CoffeeScript, I'm still on the fence, but it's clear that Jeremy Ashkenas knows his JavaScript, and his work is not done out of ignorance, so I'm glad for it to get more exposure.
- bstar 16y agoI guess I'm just amazed that they (rails core) haven't learned from the RJS mistake. These 'fads' to get around JS syntax are terrible as standards. What is so wrong with writing idiomatic, unobtrusive JS? I personally don't care for JS syntax (compared to the beauty of ruby and haml), but that's life... JS syntax my be ugly, but it can be written elegantly.
- dasil003 16y agoWhat's there to learn from the RJS mistake? RJS was fucked because it attempted to pretend JS didn't exist and muddled the separation of concerns between client and server-side; CoffeeScript makes no such mistake. CoffeeScript is much more like HAML/SASS in function, and while there are arguments against those in some environments (like if you need to hire a lot of designers without a dev mentality or environment), they've been proven to be very effective in practice, and I'm quite sure CoffeeScript will be the same.