After my oldest had been programming for a few years ze came to me and said, “I don’t understand why people talk about design and architecture like they are different. Isn’t it all just design?” I teared up a little and hugged hir. Yep, you understand.
Containment is one of the basic mechanisms of thought. Inside this boundary I think about things differently than outside this boundary:
I treat the stuff inside my skin differently than I treat the stuff outside my skin
I treat people in my family differently than I treat people out of my family
I treat lines of code inside this function differently than I treat lines of code outside this function
Okay, that last one is a stretch, but it’s the ideal. When I’m changing this function, I want to be able to consider what’s inside it while ignoring what’s outside it. Being able to make this distinction gives me freedom to think that I wouldn’t have if I had to consider all lines of code in the whole system at the same time.
And so we use chunking as a tool to enable thought when we structure programs. Sometimes a behavioral change requires changing two functions. Fine. At least if the two functions are siblings then we don’t have to consider the whole system, we can just analyze the rest of the family and stop there.
Expressions in statements in functions in objects in modules in services in repositories.
As software designers we enable behavioral change by reducing the surface area (?)/ blast radius (?)/percentage of the system to consider (?) for the changes we want to make.
And then communicate those structural changes to our peers while they communicate their structural changes to us, but that’s a story for another day.