Why does Rails become awful?

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com


Let me tell you a story about what can happen in a convoluted Rails codebase. Once, I joined an existing project. It was a huuuuge app which was running an on-line shopping community website. Complicated sales model, complicated promotions, complicated product setups, coupons, user groups, messages – it had it all. I joined them to help ship a few new features. One of my early tasks was to…add a link to something on some page. It took me few days to add this stupid link. Why? The app was a big ball of complex domain logic scattered across multiple layers with view templates so complicated, it wasn’t even simple to find the right template where the link was supposed to be added. Since I needed some data in order to create that link, it wasn’t obvious how I should get it. There was a lack of internal application APIs and relying on ActiveRecord exclusively made it extremely difficult. I am not kidding you.

My initial frustrations with Rails started quite early. I’ve become displeased with ActiveRecord after roughly first 6 months of using it. I never liked how Rails approached handling JavaScript and AJAX. In case you don’t remember or you were not around already, before Rails adopted UJS approach (which was a big subject in ~2007-2008, with blog posts, conference talks and so on), it used inline Javascript generated by a bunch of nasty helpers. As everything with Rails, it was “nice and easy in the beginning” and then it would turn into unmaintainable crap. Eventually, Rails adopted UJS in the big version 3.0 rewrite and it seems like the community agreed that it’s a better approach. This was when Merb was killed by merged into Rails. Oh, you don’t know what Merb was? Right, let’s talk about that.

…We’ve been talking about ways of improving architecture of our Rails applications for roughly 6 years. I’ve been trying to contribute to this discussion as much as I could, with articles, conference talks and by working on many OSS projects that strive to solve various hard problems.

The arguments and ideas people have had are always being ridiculed by Rails Core Team members, and especially by DHH. This has been off-putting and discouraging for me, and the reason why I never tried to contribute to Rails. I’m pretty damn sure that my proposals would end up being drastically downvoted. Monkey-patches? C’mon, not a problem, we love our 10.years.ago! New abstractions? Who needs that, Rails is SIMPLE! TDD? Not a problem, it’s dead, don’t bother! ActiveRecord is bloated – so what, it’s so handy and convenient, let’s add more features instead!