When Making A Mess Is Ok

14 Oct

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!

Advertisements

One Response to “When Making A Mess Is Ok”

  1. Sampriti Panda October 15, 2012 at 2:25 am #

    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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s