Took me 17 years of struggle, but I can finally explain cohesion in software design. I dropped the Cohesion chapter of the #TidyFirst book yesterday. I'll summarize here. tidyfirst.substack.com/p/cohesion#payWall
An element is cohesive if its sub-elements are coupled. A file is cohesive if all its functions have to be changed at the same time.
"Isn't that bad that they all have to be changed at the same time?"
Compared to what? Having those functions in different files is worse. It's easy to miss one.
Also, what if there are also a bunch of functions that don't have to be changed. Now we have to peruse those to make sure they aren't affected.
Cohesion:
* Things that have to change together *are* together.
* Things that don't have to change together are apart. Where? That's for you to figure out, designer. But likely with the things that have to change at the same time.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Folks seem to tune software development for a desired output rate. That's a disaster. Here's why, what to do instead, and (at the end) a speculation about an unhelpful belief that might underlie this behavior.
I've been surprised to see smart folks unironically suggest that waterfall development is actually the best way to develop software--specify what you're going to develop, develop it, finis!
They then adapt "the system" (by which I mean the system of folks & machines that develop the software) to the desired output rate. We have XYZ on the roadmap, we have 6 people, how can they get XYZ done quickest/cheapest?
I got into a pissing match on LinkedIn (achievement unlocked):
Them: You cashed in on Extreme Programming with all those certification programs.
Me: Ha HA! There *are no* XP certification programs.
My bad. There *are* XP certification programs. Lots. WTAF?
I have called the Certificate-Industrial Complex "dishonest", "a pyramid scheme", & "cancer". Once more for the folks who just got here:
Certificates misalign incentives:
* Employers want skilled workers. Also efficient, industrialized hiring.
* Employees want genuine knowledge & skill. Also a fast track to a well-paid job.
* Certifiers want a thriving economy of skill. Also maximum revenue at minimum cost.
Ignorance-as-a-service. My team is experimenting with frequent pair switching. Was it wasteful to be explaining the same basics repeatedly? Seemed like no, but why?
Uninformed questions are most valuable when you're likely to get stuck in a local minima. "Ignorant" questions can get you unstuck.
When you aren't clear on what problem you're solving or how you're going to solve it, lack of knowledge is a precious resource.
I assigned @arlobelshee's Promiscuous Pairing paper user.it.uu.se/~carle/softcra…. Re-reading it I was struck by the team consciously letting go of Flow as the ideal state for programming and replacing it with constant Beginner's Mind.
The goal of software design is to create chunks or slices that fit into a human mind. The software keeps growing but the human mind maxes out, so we have to keep chunking and slicing differently if we want to keep making changes.
This implies that software design is a human process with technical support, done by humans for humans. As shiny as the technical support is it took me a while to acknowledge that messy people stuff.
I’ll add that “fits into” and “maxes out” are metaphors and not precisely true, but they help make sense of a healthy, growing urge to re-design. Knowledge is not a quantity & the brain is not a space & we work together.
As part of yesterday's Invitation to Systems Thinking workshop @jessitron prepared a short play from which the students would draw various diagrams of the software development system described. At one point the manager says, "This is not acceptable," and it hit me hard in layers.
Layer 1: of course it's acceptable. You've been working like this for months, maybe years. You've accepted it all along.
Layer 2: of course it's not acceptable. If you keep going like this you'll be out of business in a year or two, maybe sooner. Something does need to change.
I've played guitar and sang for 50 years. I rarely play for anyone else. I'm haunted by the feeling that I need to be better before exposing myself to others. (Deep roots to this--story for another day.)
I have a love/hate relationship with practicing. Sometimes I do it and love it, the sense that I know where the boundaries are and I know if I'm doing it right. Sometimes I do it and hate it, since I could always be faster and cleaner.
Often I don't practice. It's exhausting not knowing whether I'm going to drift into OCD bliss or savage myself. And then I beat myself up for not practicing. (Don't worry, we're getting to the connection/redemption part of the story.)