5

Rails, to me, seems like a perfect level of abstraction for most types of web development. However, having watched some seasoned Rails consultants build an application, I'm finding that they use Gems to an extent that it's often pretty difficult to figure out what's going on in the code. As an intermediate-level Rails developer, I've had a pretty hard time digging through their code to figure out how things work, and I'm really struggling to see the payoff of this approach.

So is it me, or does Rails, by dint of the fact that it has such a vibrant community of contributors, kind of encourage over-abstraction?

3 Answers 3

1

Staying current is very challenging in the Rails community because of the proliferation of frameworks/components and the speed with which they are adopted by the mainstream. It means it takes work to stay current enough to understand new code, and that old code gets old very fast...

I program Rails only as a hobby and I don't have a prayer of keeping up; I average only one significant project per major release since .11 and I would not even call myself a Rails developer.

1
  • You know, your answer gets to the root of my problem better than I could. I think it's the speed with which all these gems come out that makes it a full-time job to keep on top of them.
    – yalestar
    Commented Nov 23, 2010 at 21:22
8

Your question reminded me of a point Paul Graham makes in On Lisp:

If people complain that using utilities makes your code hard to read, they probably don’t realize what the code would look like if you hadn’t used them. Bottom-up programming makes what would otherwise be a large program look like a small, simple one. This can give the impression that the program doesn’t do much, and should therefore be easy to read. When inexperienced readers look closer and find that this isn’t so, they react with dismay.

Also, this is a minor nitpick, but most people are referring to something else when they use the word "abstraction."

4
  • PDF available from paulgraham.com/onlisp.html
    – user1249
    Commented Nov 23, 2010 at 21:01
  • 1
    Paul Graham's point is certainly well taken, but hopefully he would also agree that there are certainly diminishing returns to simplification, especially simplification for its own sake ;)
    – yalestar
    Commented Nov 23, 2010 at 21:31
  • Re: "abstraction": yeah, you're right; I suppose "too many utilities" might have been a better way to put it.
    – yalestar
    Commented Nov 23, 2010 at 21:33
  • I was going to pick the abstraction nit but after thinking further I don't think its really far off the mark. Most of these libraries are further building up "the language" to address problems in more succinct expressions...or at higher levels of abstraction.
    – Jeremy
    Commented Nov 24, 2010 at 0:31
3

Ruby in general encourages programming at a high level, and Rails specifically encourages a somewhat declarative style of programming (one might even think of Rails as a declarative DSL for defining webpages, to an extent). As a result, Rails apps can be difficult to grok if you don't have a lot of experience with the app itself, and all the gems it utilizes. But like most things programming, to an experienced Rails programmer (and someone experienced with the specific app itself) it probably makes sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.