The importance of direction
I was reading Kent Beck's new book (not quite a book but something not far off) called Tidy First? and a paragraph in in the chapter tl;dr Cohesion caught my attention. Kent Beck writes:
It can be difficult to see how to de-couple elements. Increasing cohesion, on the other hand, is easier to imagine.
The chapter talks about how we can, on a line by line basis, identify coupling, extract and changes coupled code separately and even inline the extraction when done. He also talks about what cohesion is. All very interesting and well worth reading, but it was not the topic that all of a sudden popped up and pulled my attention away.
What did was the change in direction in the two sentences above.
It can be difficult to see how to de-couple elements.
There is a clear direction in the above sentence. It's negating coupling, I.E. moving away from coupling.
The human brain doesn't do negation well. Nor are we particularly good att walking away from something since we constantly need to look over our shoulder to figure out if we're still moving away. Loosing focus on where we are going and risking stumbling on things in-front of us.
Thus, it's difficult to de-couple.
Increasing cohesion, on the other hand, is easier to imagine.
Increasing something also has a direction. Ahead, in the same direction we're going. It's for, not against. And we don't loose focus on what's ahead. We are constantly looking ahead. Walking towards something is easier for that simple reason.
Thus, it's easier to increase cohesion (which is good by the way since cohesion is often far more difficult to explain).
Not that this is news to anyone (I hope), but nevertheless an important reminder.
If we can formulate an action or thought in such a way that it is pointing us ahead instead of away from it is far easier for us to act and think accordingly. I dare say that this is so important that sometimes it's more valuable to identify a vague goal ahead and adjust it as we go than to walk from a clearly defined thing we don't want. Especially so in software. Something that's so abstract that we are struggling to understand it even at the best of times.