3 ms·
Wasn’t CoffeeScript the preferred way to write JS in Ruby on Rails for years?
by ChrisLTD 6y ago
Wasn’t CoffeeScript the preferred way to write JS in Ruby on Rails for years?
- scrose 6y agoI think the Rails resource generators still default to creating Coffeescript files. I could be wrong though — I switch between Rails 4,5 and 6 projects right now. I’ve been on over a dozen Rails projects at different companies and only ever worked one project that used Coffeescript in production, and that was an app built pre-2010.
- nullserver 6y agoHAML and coffeescript.
- aendruk 6y agoI miss the elegance of Haml. Moving from an indented syntax for DOM literals to the likes of JSX felt like a step backwards.
- scrollaway 6y agoMaybe for you, but that is not a popular opinion. JSX's rigor is a breath of fresh air in a world that constantly generates low quality html due to loose constraints. HAML had those same problems. JSX is kind of xml done "right". Differences between children and attributes in xml is very hard to grasp, but JSX has a much better defined structure to it and is super well suited to generate html because of that.
- aendruk 6y agoThis sounds like an orthogonal point. (I agree with it, so it feels odd to see it presented as a rebuttal.) Surely an indented syntax could have rigor if we wanted it to?
- scrollaway 6y agoSure, if we wanted it to, but HAML wasn't that.
- aendruk 6y agoYes.