When Making A Mess Is Ok

Starting a project is super fun, especially with Rails. Your code is clean, you’re adding tests, and you’re refactoring. But there is no running away from the reality. As you add more features and debug and change things, your code will become a big spaghetti mess in a matter of only a few days. So how do you deal with this?

Check out this great talk by Sandi Metz: Go Ahead, Make a Mess


As I’ve been learning Object Oriented Programming, one of the things I know I need to work on is getting rid of the IF statements! However, that seems to be harder for me in practice. I really loved Sandi’s solution in the talk:

She went from this:

 

To this:

Amazing!

Enjoy the article? Join over 14,500+ Swift developers and enthusiasts who get my weekly updates.

  • Wow, an amazing solution. I was taking the SaaS course offered by edX which teaches Rails and I had the first line of the solution ready but I did not understand how to turn it into a Class Constant. Thanks a ton!