« « Thoughts on Refactoring – Chap. 5, 6, 13, Selected refactorings

An introduction to design patterns — trying again » »

Refactoring: Real world benefits of soaking it in

Posted by on Jul 10, 2014 in Uncategorized | No Comments

After last week’s marathon reading session, we took a week off with no readings, to better absorb and apply what we’ve learned from refactoring. (Or take a break for the July 4th weekend. But the first one sounds better.)

I did, at my editor’s recommendation, reread the Code Smells chapter after having gone through several of the refactorings, since those refactorings are referred to in Code Smells, even though they come later in the book. That was actually a really helpful exercise — I had a better understanding of the references to refactorings I had read, and even understood ones I hadn’t read, since I was less intimidated by refactoring names.

I’m already seeing this ALL OVER my work. I think twice about repeating code, and feel like I need to break out functions. There’s a reason for using temporary variables when I use them, clear naming seems more important. I had to do an exercise where I wrote code to be fixed, intentionally not using these precepts, and it was really hard to go back. The strangest part was I had to resist the urge to do it “right”, where the old me would just get it done to get it done. I’m really affected by the idea that I have to code for the “me” of the future.

This week alone, I have stopped myself from unnecessary repetition, poor naming, additional complex conditional branches, just generally sorting long functions and more, just because the precepts of the book are holding me accountable. (Editor Troy said recently, and I’m paraphrasing, that you should think twice about a function’s length if you can’t see the whole function without scrolling.)

And one other thing I’m noticing, and I’m not sure if this is more or less important, is I’m starting to use the language and jargon, and pick up when other more experienced developers around me use the language. It enables us to communicate more easily. I’m even more confident in asking questions about what I don’t know, because I figure nothing is over my head forever, I’ll just learn it like I’m doing with this. And that’s an adrenaline high like almost nothing else I can imagine!

« « Thoughts on Refactoring – Chap. 5, 6, 13, Selected refactorings

An introduction to design patterns — trying again » »