Our programming languages are often structured around the problem domain of compilers and the archaic (for most of us) task of converting things people understand to a thing the computer can execute.
Why don’t our languages have deeper support for the ways we reason about problem domains or the ways we struggle to reason. For example, why aren’t state machines and checking their sanity (or marking their unsoundness) a thing in pretty much any language?
The unhelpful answer is “because you can write a state machine in library code”. Which leads me to ask, why don’t we have popular state machine clones? Why is there no xUnit or Sinatra of state machines that is widely cloned to fresh and exciting languages?
The cynical answer is “because many programmers don’t want to think that hard”. The optimistic answer is that there’s room for someone to capture this problem space as well as xUnit did for programmer testing or Sinatra did for turning URL-like strings into method calls. You could be famous!
Passing thoughts on the discography of The Clash that is not London Calling:
Brian and I had a conversation that randomly veered onto the Clash which prompted to me to listen to all of their studio albums
I have listened to London Calling a few times before, and recall some story about its producer encouraging them to go broader with the album so as to reach a wider audience; basically that it’s not much like their other albums
I enjoy London Calling, but I’m not sure what to expect from a categorical English punk band
My favorite advice on the topic of method visibility (i.e. public vs. private) comes from Python creator Guido van Rossum. It goes something like “we’re all adults here” and says it’s not really a necessary thing for compilers/runtimes to hide methods from specific callers. Don’t go mucking around in other object’s implementations. I still think that’s mostly right.
Except, coming up to speed on a new code base is vastly easier when there’s some delineation of the waterline between an object’s public API which it expects other objects to use and its private implementation which it does not. It tells me a) the private methods are open for change and refactoring and b) below the private “waterline”, don’t bother going any deeper when spelunking to figure out how this program works.
In a new or strange codebase, every little bit of tractability helps.
A few years ago, I was re-infected with enthusiasm for cars. I came upon One Car to Do It All and found a new reason to obsess over cars.
I read Car and Driver and Road and Track as a teenager. I was excited by the agency that cars bring (who isn’t?). It was a fun thing for me to nerd out about: technical specifications , comparing feature lists, and of course benchmarks! There was also a slight bit of romance to automotive journalism, ostensibly all writers traveling the country (or world) driving neat cars in beautiful places, often quite quickly.
Now, I’m taken by the history of specific manufacturers and how older models of cars became the current models. The technology and coordination needed to produce the modern car appeals to my technological side. The shape of cars new and old is a fun subjective conversation (e.g. are exterior about form or function?).
Most people do not view cars this way. They are automotive pragmatists. They want a car like they want a refrigerator or washing machine. The car is an appliance. It takes you from where you are to where you want to go without drama, in a modicum of comfort. The quality of the steering feedback, the particulars of the engine, or the predecessor of the car from two decades ago are nothing. The optimization is all around cost of ownership and utility.
(For the sake of symmetry I feel compelled to write another couple paragraphs on automotive pragmatism. But, there’s really nothing else to say. It’s pragmatic through and through.)
A curious thing happens when my car enthusiasm interacts with pragmatic car owners. Some of them will encourage me to talk about my enthusiasm. Mostly, it seems a little awkward, as though they’re afraid I somehow experience cars in a better way than they do. This is totally not the case, I can’t even really drive a stick!
In a way its not actually that curious. Car enthusiasm and the cars enthusiasts own correlate highly with elitism, which is by definition intimidating. But it does make me wish I had a shorthand for “I drive this car because its interesting to me, but I won’t judge your car, now tell me what you’re enthusiastic about that I don’t understand”.
That said, I like that GraphQL (and JSON API) let service developers focus on exposing a specific data model and optimizing access to it rather than taking a side quest through REST API design. For application developers, building screens and interactions with the data they need defined inline seems like a big win for contextual understanding.
As ever, the risk of using any kind of mapping layer, whether its objects and relational data or JSON object graphs to downstream service calls, is creating a naive, one to one mapping that create awkwardness and inefficiency.
Which leads me to wonder, did the CIA invent these tactics, or did they discover them? Were they sitting around, talking about how big of a jerk John is at meetings and how he’s causing the Communists to win? And then they said to themselves, “hey, what if we had low-level agents just be like John?!”
And thus, the CIA made the world just a little bit less great.
Simples! We take the next feature that we are asked to build, and instead of detouring around all the weeds and bushes, we take the time to clear a path through some of them. Maybe we detour around others. We improve the code where we work, and ignore the code where we don't have to work. We get a nice clean path for some of our work. Odds are, we'll visit this place again: that's how software development works.
Check out his drawings, telling the story of a project evolving from a clear lawn to one overwhelmed with brush. Once your project is overwhelmed with code slowing you down, don’t burn it down. Jeffries says we should instead use whatever work is next to do enabling refactorings to make the project work happens. Since locality is such a strong force in software, it’s likely that refactoring will help the next bit of project work. Repeat several times and a new golden path emerges through your software.
In other words, don’t reach for a new master plan when the effort to change your software goes up. Pave the cow paths through whatever work you’re doing!