Tags
Language
Tags
April 2024
Su Mo Tu We Th Fr Sa
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4

Fearless Refactoring: Rails controllers

Posted By: AlenMiler
Fearless Refactoring: Rails controllers

Fearless Refactoring: Rails controllers by Andrzej Krzywda
English | 27 Apr. 2017 | ASIN: B0722L7D1M | 324 Pages | AZW3 | 680.18 KB

Coding an app in Rails is always fun… for the first 3 months.

After some time, small, little things show up. The tests are no longer below 1 minute. Thin controllers are not really so thin anymore. Single Responsibility Principle is more of a not-so-funny joke than something that you can apply to your Rails models.

The build is taking so long at your machine, that you've almost automated it to immediately open Twitter, gmail, FB, HackerNews because nothing else can be done during the tests.

The speed of adding features slows down. It's no longer fun to demonstrate new features to the Customer.

Your development plan for this release sounds so great. The users could be so happy with the new features. Your code could be so elegantly designed.

Is this really all you did this week?

"Can we agree that we keep controllers thin?" - the team starts to have those little arguments. The model callbacks are killing you. They started simple and now you just keep adding the conditionals.

How can we unit test if it's all coupled together?

You'd love to unit test your models and controllers, but something doesn't feel right about the endless section of mocks, stubs. User.should_receive(this), should_receive(that). It feels like repeating the code. What's the point of such tests?

How do other Rails developers deal with such problems? Rails conventions are great at the start, after that you're on your own.

This shouldn't be so hard!

What if you could have speedy and intuitive conventions even after the app grew over time?

If you had conventions, you would spend less time moving code from one place to another, hoping that you will hide it somewhere. Less time arguing in the team means more features being delivered. More features means happy customers. We want to have happy users and customers.

What if you could add features as fast as at the start?

Fearless Refactoring: Rails Controllers - the e-book

It's possible to have the same speed of delivering features over time and the "Fearless Refactoring: Rails Controllers" e-book will teach you how.

Make your application better, simply, step-by-step, under control.

I took what's best from the popular architectures, got rid of things that don't fit well with the Rails specifics and prepared recipes how to deal with a messy Rails code.

Who has time to stay on top of all the latest articles, ideas, and code samples? You need good, working, easy to change code.

This book is a step-by-step guide how to introduce a service layer in your existing Rails app. Every step is described in every detail, with code changes. All of that, so that you can safely refactor your codebase, even without a full test coverage.