Lorem ipsum dolor sit amet, consectetur adipiscing elit lobortis arcu enim urna adipiscing praesent velit viverra sit semper lorem eu cursus vel hendrerit elementum morbi curabitur etiam nibh justo, lorem aliquet donec sed sit mi dignissim at ante massa mattis.
Vitae congue eu consequat ac felis placerat vestibulum lectus mauris ultrices cursus sit amet dictum sit amet justo donec enim diam porttitor lacus luctus accumsan tortor posuere praesent tristique magna sit amet purus gravida quis blandit turpis.
At risus viverra adipiscing at in tellus integer feugiat nisl pretium fusce id velit ut tortor sagittis orci a scelerisque purus semper eget at lectus urna duis convallis. Porta nibh venenatis cras sed felis eget neque laoreet suspendisse interdum consectetur libero id faucibus nisl donec pretium vulputate sapien nec sagittis aliquam nunc lobortis mattis aliquam faucibus purus in.
Nisi quis eleifend quam adipiscing vitae aliquet bibendum enim facilisis gravida neque. Velit euismod in pellentesque massa placerat volutpat lacus laoreet non curabitur gravida odio aenean sed adipiscing diam donec adipiscing tristique risus. amet est placerat in egestas erat imperdiet sed euismod nisi.
“Nisi quis eleifend quam adipiscing vitae aliquet bibendum enim facilisis gravida neque velit euismod in pellentesque massa placerat”
Eget lorem dolor sed viverra ipsum nunc aliquet bibendum felis donec et odio pellentesque diam volutpat commodo sed egestas aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod eu tincidunt tortor aliquam nulla facilisi aenean sed adipiscing diam donec adipiscing ut lectus arcu bibendum at varius vel pharetra nibh venenatis cras sed felis eget.
Rails, as a web framework, is great for getting a web app off the ground quickly. Whether it's a personal project or the early stages of a startup, you’re almost guaranteed to find everything you need in its core libraries to ship something fast. But as your app grows and the domain complexity starts to pile on, you might notice something: the Rails documentation doesn't always have the answers for the kinds of problems you're now dealing with.
the Rails documentation doesn't always have the answers for the kinds of problems you're now dealing with.
As your project matures, the straightforward guidance that Rails offers starts to fade, and you’re left with questions that don’t have clear answers in the docs. That’s when friction starts to creep in. You’ll find yourself writing code that doesn’t quite fit into the standard Rails patterns, or relying on libraries that feel like they're just bolted on. Worse yet, you might end up with code that's difficult to maintain, riddled with performance issues, or just plain buggy. And suddenly, that "magic" that made Rails so appealing starts to feel like a burden.
At this stage, the issues you’ll run into usually fall into one or more of these three categories:
In this article, I’m not here to talk about the quick-fix Rails solutions for hobby projects. I’m talking to the developers who’ve spent months (maybe years) working on growing Rails apps—developers who have hit the same roadblocks I have, and who have searched the docs for answers that aren’t there. If you’ve been struggling with finding a path through some of Rails' hidden complexities, stick with me. I’m going to walk you through three common challenges that the documentation just doesn’t cover, and what you can do to navigate them without tearing your hair out.
But before we dive into the specifics, let’s start with some foundational principles that will help you reduce the friction in these situations.
These don't apply to the development of Rails apps alone, but are particularly relevant in Rails in my opinion, because of the problems we mentioned earlier.
For that reason, keep these in mind:
One of the biggest downfalls of a developer is abstracting too much too early, foreseeing problems that may never be relevant for the future of the company. I have been too many times guilty of doing this myself, and worked long enough to see how damaging it could be in the long run.
When an organisation strives to “keep things simple”, too often are arguments construed in favour justifying a particular solution by calling it “simple”, when the author of the argument actually means “easy”. By this I mean that, in order for you to consider something as the “Simplest solution”, your considerations should not revolve around the time it takes to develop it, but around the total time and maintenance costs of the feature. Not to say that a solution can’t be easy and simple, on the contrary, that’s the ideal scenario, and by taking simple solutions you’ll guarantee than in the future you’ll have an easier time find the simple solution.
Don’t go against existing patterns if you believe you’ve found a better one, unless you can entirely replace the existing pattern, otherwise you’ll end up with 2 patterns, and where there’s room for 2 patterns that do the same thing, there’s likely room for a third, and so on.
Always remember that following patterns will make your code better and easier to maintain than introducing a new pattern that others will need to learn.
[To be continued]