One of the things I learned from @KentBeck years ago was to see cohesion in terms of divergent change rates. If you have a class and there's a set of methods that you tend to change together while leaving others alone, that set of methods could be a separate responsibility.

Once I saw this, I went so far as to write a script to mine classes in Git and find clusters of methods that all seemed to change at the same time.
Often the results were not surprising. You could've see new responsibilities emerging just by looking at the names of methods and variables. But, sometimes this time view of the code was the first indication that a class was trying to split.
Code isn’t special that way. This is all systems stuff. If you have a group of 10 people and 3 of them often change their minds together, you can start to see them as a separate group. They may even start to see themselves as a separate group. Why does this happen?
At its base, it’s because of the tension between N and N^2. As the number of things increases, the number of possible interconnections grows (bounded by N^2). It’s harder for 10 people to coordinate than 3, so we shouldn’t be surprised to see groups from cliques periodically..
..it’s a natural tendency in systems. Sort of “the grain of the wood.”
Code is the same way. It grows through human attention. We’re loosely bounded in the number of concerns we can keep track of at once. But, again, it’s not the number of concerns that is the significant limit, it’s the number of ways that they can interact.
So, we focus, and form little areas of code around concerns even when they aren’t even consciously apparent to us yet. If we ignore our felt-sense of these dynamics we end up with legacy code.
Legacy code.. So, let’s relate this back to divergent change. I think that the core problem of software development is that code and team change at different rates.
If team turnover is faster than code turnover, you have knowledge loss. You need to prop up your code with more tests and documentation, and hope for the best.
There’s only so much that can be done about this problem. People are going to move on. The code that they wrote will remain.
A hardcore development organization would rip out the code of each developer as they leave.. by the roots, and rewrite it so that the knowledge of it is fresh in the remaining team, but I’ve never seen that as a consistent practice.
Code is perceived to have too much value. In reality, the active knowledge of a cohesive team is the value.
Mob programming is one manifestation of this understanding. It's one way to go.
But, to me, the important thing is to understand these costs of coherence and coordination. When we focus on them, we have many possibilities.

More from Business

You May Also Like

This is a pretty valiant attempt to defend the "Feminist Glaciology" article, which says conventional wisdom is wrong, and this is a solid piece of scholarship. I'll beg to differ, because I think Jeffery, here, is confusing scholarship with "saying things that seem right".


The article is, at heart, deeply weird, even essentialist. Here, for example, is the claim that proposing climate engineering is a "man" thing. Also a "man" thing: attempting to get distance from a topic, approaching it in a disinterested fashion.


Also a "man" thing—physical courage. (I guess, not quite: physical courage "co-constitutes" masculinist glaciology along with nationalism and colonialism.)


There's criticism of a New York Times article that talks about glaciology adventures, which makes a similar point.


At the heart of this chunk is the claim that glaciology excludes women because of a narrative of scientific objectivity and physical adventure. This is a strong claim! It's not enough to say, hey, sure, sounds good. Is it true?
I’m torn on how to approach the idea of luck. I’m the first to admit that I am one of the luckiest people on the planet. To be born into a prosperous American family in 1960 with smart parents is to start life on third base. The odds against my very existence are astronomical.


I’ve always felt that the luckiest people I know had a talent for recognizing circumstances, not of their own making, that were conducive to a favorable outcome and their ability to quickly take advantage of them.

In other words, dumb luck was just that, it required no awareness on the person’s part, whereas “smart” luck involved awareness followed by action before the circumstances changed.

So, was I “lucky” to be born when I was—nothing I had any control over—and that I came of age just as huge databases and computers were advancing to the point where I could use those tools to write “What Works on Wall Street?” Absolutely.

Was I lucky to start my stock market investments near the peak of interest rates which allowed me to spend the majority of my adult life in a falling rate environment? Yup.