Skip to content

Comment on ActiveRecord (and Rails) Considered Harmful

Comments

I've had many of the same thoughts about Rails over the years. I think the view model idea is definitely worth exploring... it would certainly rid models of a bunch of view-related stuff that doesn't manage to end up in helpers.

One piece of coupling that really bugs me is doing stuff like link_to(@foo) that will autogenerate a URL based on the class name of the model. To me, this is way worse than the table names and makes the routes highly coupled with the underlying class naming structure. Way too much magic...

Uh, "magic" code isn't "magic", it's just code you don't understand. The obvious solution is to stop writing it off as "magic" and learn to understand it.

That's a poster child of convention over configuration. One huge benefit of which is maintainability.

AboutSource Built by g1lg1l

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