Sandi Metz’s talk on object oriented refactoring was the one that floored me. I’m always interested in looking at other people’s refactoring process because you can glean so much from it. It’s one of the most subjective areas of programming, there’s so many ways to approach a system, and doing it well is downright artistic. Using the object model as a refactoring tool in the way she showed was like opening up an entrirely new perspective to me. She showed that the process can build up much complexity but at the end you’re left with some beautiful, squint-test passing code. Another great point from that talk was to not reach for the abstraction right away. Duplication in the end is cheaper than getting the abstraction wrong.
A similar bit hit in a similar talk, this time on the front end. Refactoring to EmberJS eloquently expressed a common problem. Tacking on simple jQuery methods to a page to support a growing feature request list.
“You’re agile, right? So you just agile your code right in there!”
He showed how taking a bit of time to leverage a framework like Ember and think about the page’s data models we can have front end code that’s much cleaner, easier to understand, don’t directly manipulate the DOM, and gives us the flexibility to extend functionality in the future.
Another general idea that came up again and again was a reinforcement of one planted during my apprenticeship. Read code, get a feel for things, understand why things were written a certain fashion. These things will develop your instincts and ‘code smell’ ability. If you’re deviating from a well established pattern especially in Rails, make sure you have a good, defensible reason to. Write small code and classes that do one thing, and does it well. It was a nice affirmation of the ideals I was taught and strive for in my work.
All in all it was a great experience getting to meet members of the community and gain some insights and perspectives from some of the thought leaders in the field. Looking forward to the next opportunity to do it again!
Have a comment or question? Send us a note. It won't be shown here and email isn't required, unless you'd like a