A Better Way to do Rails with Aldous

About a year ago the Tuts team encountered an issue with our Rails codebases becoming more unwieldy as they got bigger. Our development pace was slowing down and new features and fixes would cause regressions in unexpected parts of the system. This is a problem that many of us have encountered before, and we often treat it as part and parcel of doing business. This time, however, we decided to see if we could find ways to improve the situation.

Our goals were:

  • keep a constant development pace regardless of the size of the codebase
  • ensure that new features and fixes don’t cause regressions in unrelated parts of the system

Focusing our attention on OO design helped to address some of these concerns, but along the way we found a few common threads which could be codified into some helpful patterns. We created a gem and slowly started augmenting Rails, trying things out on our own codebases as we went. A little while ago, we decided that our gem was finally useful enough to release publicly.

Meet Aldous - a Brave New World for Rails with more cohesion, less coupling and greater development speed.

The main issues common to larger Rails codebases that we try to address are:

  • bloated models which don’t respect the SRP
  • controllers that contain a lot of logic, spread around many before_actions
  • the lack of proper view objects, having to make do with templates and helpers

Have a glance over the README, it is pretty extensive. We also plan to write a few blog posts about how to use Aldous, as well as give more detail about some of the motivations behind it. As the blog posts appear, we will add them to the README.

We hope you’ll give it a try. Bug reports, pull requests and general comments are welcome.