The third great conference talk I want to share is Ben Orenstein’s Aloha Ruby Conf 2012 talk called Refactoring from Good to Great.
Ben shows some common refactoring patterns by doing live coding on stage. He not only covers what he’s doing, but he also talks a lot about the why. I learned a tremendous amount from this talk.
Here are some of the topics he covers:
- Extracting temporary variables to query
- Tell don’t ask
- Reducing parameter coupling by extracting data clumps into an object
- Feature envy
And a few more.
My favourite quotes from the talk are:
I’m starting to think, these days, that methods longer than a line are a code smell.
Most intermediate object oriented programmers are too reluctant to extract [small] classes.
That’s what’s hard about software, is responding to change. I saw a keynote by Dave Thomas, and he said “The only thing worth worrying about when you look at code is: is it easy to change?”