Practical Object Oriented Design in Ruby – Sandi Metz
A great guide for both beginners and intermediate programmers that really helps you think about SOLID design principles.
Objects on Rails – Avdi Grimm
One of my favorites, this book contains many thought experiments represented in code. What if the ActiveRecord API was made private and you used it truly as a data abstraction layer and nothing more? Food for thought that will make you write better code.
Clean Ruby – Jim Gay
Another book that makes you think – while some of the code examples are pretty different than what you find in vanilla Rails apps, this gives you some ideas for how you could write loosely coupled code using the ideas of Roles and Contexts.
Growing Object Oriented Software, Guided by Tests
A classic affectionately known as GOOS – the examples are in Java but very relevant to what we’re going through in Ruby land these days.
Clean Code Handbook – Uncle Bob Martin
Again, not Ruby specific, but lots of good basic code hygiene ideas that will keep your code smelling and feeling fresh even when it’s had a hard day.
Keynote: Architecture the Lost Years – “Uncle Bob” Martin
The granddaddy of architecture talks – I love this because it totally changed my perspective on writing code from being Noun/Resource oriented to reifying some of the complex Verbs that happen in larger systems. The result is simpler to understand classes that are easy to reason about.
Hexagonal Rails – Matt Wynne
Takes some of Uncle Bob’s ideas about decoupling and applies them to Rails. Some of this code will seem foreign coming from vanilla Rails approaches, and it doesn’t become apparent that it is useful until you’re knee deep in a larger project. But give it a chance, it actually helps a lot to decouple yourself a bit.
Fast Rails Tests – Corey Haines
If you’re still firing up your Rails to run tests, this talk will set you straight.
Why you don’t get mock objects
A great talk that goes hand in hand with the GOOS book. Talks about when you would use mocks vs stubs, what the difference is, and why you should care. A very clear and concise delivery that might clean up your testing approach.
7 patterns to refactor fat ActiveRecord models
One of my all time favorite articles that encompasses many different object oriented patterns. It’s actually less about ActiveRecord than its title might entail. The reason it even mentions AR is that most people stuff the majority of their logic into ActiveRecord models. Even if that doesn’t sound like you, this article provides many ideas from View Models to Service and Policy objects.
Gary Bernhardt – Boundaries
Probably my favorite of Gary’s work. Very information dense and worth pausing every few minutes and really digesting. I’ve often intuitively refactored code into functional and imperative pieces but this talk really clarifies how you go about seeing those patterns and separating your APIs so that their boundaries are simple and easy to test.