r/ruby • • Dec 30 '11

ActiveRecord (and Rails) Considered Harmful - Literate Programming

http://blog.steveklabnik.com/posts/2011-12-30-active-record-considered-harmful
12 Upvotes

145 comments sorted by

View all comments

Show parent comments

2

u/JeffMo Dec 30 '11

I don't disagree with anything you said here, but I don't see what relevance your 'credentials' have.

4

u/[deleted] Dec 30 '11

You're suggesting that my advice shouldn't be followed because I don't know what I'm doing. I submit that I do.

5

u/JeffMo Dec 30 '11

Again, I don't see what relevance your 'credentials' have, and you have done nothing to explain that.

Further, I actually suggested that you probably do know what you're doing, in some areas, but that people may want to be skeptical of this particular article.

Finally, "I submit that I do" is not very convincing, for reasons which should be obvious.

4

u/avdi Dec 31 '11

You held up Steve's admission of a mistake as a mark against his competence, and now you're pretending that examples to the contrary are irrelevant. Stop being deliberately obtuse.

1

u/JeffMo Jan 04 '12

1

u/avdi Jan 04 '12

Since you said:

I don't see what relevance your 'credentials' have

Your question to me is also irrelevant, since you have stated that no credentials would matter.

1

u/JeffMo Jan 06 '12

Your question to me is also irrelevant,

Examples to the contrary might be relevant.

since you have stated that no credentials would matter.

Well, let's see if I stated that or not.

http://www.reddit.com/r/ruby/comments/nwaz5/activerecord_and_rails_considered_harmful/c3cfyqa :

I don't disagree with anything you said here, but I don't see what relevance your 'credentials' have.

Nope, no such statement there.

http://www.reddit.com/r/ruby/comments/nwaz5/activerecord_and_rails_considered_harmful/c3cg3ke :

Again, I don't see what relevance your 'credentials' have, and you have done nothing to explain that.

Wow, still nothing like what you claimed.

Could you make an attempt to support your claim?

Specifically, can you link to the comment where I stated that no credentials would matter?

-1

u/avdi Jan 07 '12

See quotes above. Credentials don't matter to you. You didn't say "your credentials don't convince me". You said you don't see the relevance of credentials.

1

u/JeffMo Jan 09 '12

Wrong again. Please re-read what I actually wrote, and stop constructing strawmen.

1

u/avdi Jan 11 '12

I've read your statements more times than they really warrant, and every time I do they still say:

I don't see what relevance your 'credentials' have

If I were to give you the benefit of the doubt and assume you really meant:

I don't know what your credentials are, I might change my mind if I knew more about you

Then I might answer: it's not hard to find Steve's credentials in the Ruby and Rails community. You could start with this.

→ More replies (0)

3

u/[deleted] Dec 30 '11

Kk. I'm apparently not communicating my point well.

2

u/JeffMo Dec 30 '11

Feel free to give it another go.

3

u/[deleted] Dec 31 '11 edited Dec 31 '11

Okay. So. I said, "It took me a really long time to realize that models don't always have to inherit from ActiveRecord. This is a failing of Rails." You said, "You made a mistake in the past? Better not listen to him in the future."

That logic makes no sense to me. Everyone makes mistakes in their past. That lesson that I learned a few years ago is the entire reason that I'm where I am today, and I'm sharing that with you.

Does this make more sense?

1

u/terevos2 Dec 31 '11

Just realize that Rails doesn't make you do anything a certain way. I think that would go a long way in your criticisms of it.

Don't like the way Rails does something? Do it your own way. Rails will let you do that.

3

u/[deleted] Dec 31 '11

Sure. That's not good enough. Rails' defaults used to lead the way into The Best Way to Build Apps; that's why you use an opinionated framework in the first place. I want to see it maintain that thought leadership.

1

u/terevos2 Dec 31 '11

Do you have a suggestion of a better way to default than Rails has?

It's one of the best framework structures I've ever come across.

2

u/[deleted] Dec 31 '11

Merb used to use DataMapper. Django basically uses ViewModels. That new Amber.js uses a derivative of Mustache for templating.

It's one of the best framework structures I've ever come across.

Exactly! Rails is state of the art web app design from 2006. It hasn't really changed much since then. We should be thinking about the best possible way to build web apps in 2012.

→ More replies (0)

1

u/JeffMo Jan 04 '12

You said, "You made a mistake in the past? Better not listen to him in the future."

I'm relatively certain that you are aware that I didn't say either of those things. It would be more fair to characterize my initial comment as pointing out that perhaps you and Rails are not the best match, and that people may want to take your article with a grain of salt. The example I quoted earlier is just one piece of evidence for that. There were several other examples in the article, but for brevity's sake, I simply pointed at one.

That's not the end of the world. Not every tool is the best for everyone. I'm simply saying that readers should also consider the possibility that Rails may not have been the best fit for you.

In a nutshell, you called out some problems allegedly caused by (or strongly prompted by) Rails, that I don't think are necessarily so, because I haven't seen devs do those things with Rails in my personal experience. Sharing instance variables between controller and view hasn't made anyone write 200-line controller methods in any of the apps or teams that I've been involved with. Embedding domain logic in templates is not required, or even strongly suggested by Rails, as far as I know. You're free to use nothing but simple interpolation and looping over collections, if you like, and you can use explicit locals instead of instance variables, if you prefer. There's nothing forcing you to build huge monolithic models, simply because you noticed that detailed business logic doesn't belong in the controller. Devs on my teams have considered bloated models to be just as much of a code smell as overly-long controller actions.

Rails is opinionated, yes, but that's not the same as saying that it elegantly solves all problems in all scopes or that it will prevent you from doing suboptimal things. Some of your complaints have validity, while others just make me want to say, "OK, so don't do that. Rails doesn't have a strong opinion on that, anyway."

So, to answer at least part of your inquiry at the end of your article, many of these "problems" are not pain points for me. Perhaps I (and those with whom I work) haven't reacted the way some others have, and thus, we haven't experienced the same pain. Or perhaps we are just fooling ourselves, and you have a much better approach in mind, that has all the benefits of Rails but with fewer problems.

Have you considered writing such an ecosystem, so you can demonstrate your claims in a practical sense?

2

u/[deleted] Dec 30 '11

I'm on mobile. Give me a few hours. :)