Refactoring and testing

Posted on 11 February 2020. Tagged with web development, testing, ruby

I'm not a very careful programmer. I care more about getting things done and working on cool new ideas than meticulously refactoring and testing code.

But I want to change. If I'm going to make a real career out of this, I need to level up and get more comfortable refactoring code and making it more reliable.

I just watched this great talk on YouTube by Sandi Metz - Get a Whiff of This. It's from RailsConf 2016 and it's about code smells.

Metz introduces the code smells introduced by Martin Fowler in his book Refactoring. She groups them into five categories:

She then demonstrates how these code smells can be fixed using refactoring recipes. They are mechanical, concrete techniques for solving these problems - you don't need to reinvent the wheel.

It's pretty exciting that there is a limited number of techniques that will solve many problems, and that they all have names - it makes the whole thing less wishy washy.

Anyway, I'm going to make it a goal of mine this year to read Refactoring and learn some of these techniques.

If you have any tips, please send them my way.

I don't have comments on my blog yet. Tell me what you think on Twitter.