Slide 42
Slide 42 text
Red-Green Refactor
✦ Talking syntax ✦ Talking factoring
✦ Entering code
✦ Leaning close
✦ Moving code
✦ Sitting back
@sarahmei
42
First, the words we say change. Now if you're pairing these are the words you say out loud,
but if you're on your own, this is your internal monologue.
Either way, we go from discussing the nuts & bolts of the functionality: "oh hmm, I think we're
missing an end. Maybe that context doesn't need to be there. That looks like a variable we
could inline." …and we start discussing considering larger concerns: "this method started out
with a name that made sense but now it's not quite right. Maybe it doesn't belong in this class
any more. Or maybe we could rename it to be more appropriate."
Second, the keys we press change. We go from entering code, entering logic, putting in our
eaches and injects, and we change to moving code around, between files, between classes.
We cut & paste. I'm giving us the benefit of the doubt that we're not cutting & pasting up
here.
Third, how we sit changes. When we're red-green-red-green, we get close to the screen. Even
if it's a big screen - ever notice that? But when we're refactoring, we sit back. We take our
hands off the keyboard. We put our hands behind our head. We look at the code without
changing it.
Fundamentally what's happening is that in these two modes, we are thinking differently about
the code. How we are thinking has changed.