RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

ActiveRecord (and Rails) Considered Harmful

I just posted a new blog post. New years’ is about reflection, and here’s some of my reflections on how Rails could improve.

Comments

Awesome post

Mr. Klabnick, That was a very interesting post, thanks for sharing.

I’d be curious to know if there were a full/real implementation of the data mapper pattern in Ruby, do you think this would diminish the concerns you raise.

It seems like there are ways to somewhat mitigate some of the concerns you raise about Controllers (perhaps decent_exposure) and Views (presenters).

Best, Mike

Hey Mike!

do you think this would diminish the concerns you raise.

My real concern is what the defaults are. decent_exposure, draper, and other gems are great! They help me write good code. But I don’t want to screw around with my framework to get good code. It should help me, not hurt me. I want Rails best practices to be actual best practices.

Steve, Thanks for replying.

My real concern is what the defaults are. …

That makes sense. Its almost like the broken window syndrome I guess. If its not fixed, high level users will avoid rails. Even worse, junior users will unknowingly abuse it.

I guess in my head I was wondering what your angle might be to pick a problem that is the most vexing to suggest a good incremental first step. Decent exposure and draper seem to scratch the itches you have in the model and controller realms. But the datamapper project does not seem to really fully implement the data mapper pattern yet (it looks like v2 will more in this vein but I’ve no idea of the velocity of this project).

If the defaults are poor, but there are work-arounds/alternatives, a technology/framework can still be fantastically productive (I long put mySQL in this category). With ActiveRecord, Datamapper, and Sequel all implementing the active record pattern, it seems there is no alternative outside of Jruby and a Java ORM. So even if you wanted to do something different, its roll your own or forgo using C Ruby; that’s why I focused on ORM.

Again, great post and I hope it spurs lots of rich discussion in the community, thanks for sharing it.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in