Software professional with 25+ years in SaaS product development, coding, consulting, platform transformations, and data migrations.

Contact: hikingdave @ gmail.com

Electricy is UX, Plumbing is middleware

As a professional coder, I have spent 25 years mostly working inside my own head -- living in the physical world, but focused on intangible concepts, logic and data structures. But I also own a house, and do DIY repairs on it, so I make analogies between the systems in your home, and software systems.

Electricity is pervasive in homes, at least in the developed world. In the typical suburbna home in the USA, it literally runs through every wall and ceiling, with cables entending out in every room to various devices. We engage with it constantly. Sometimes that is active engagement with a kitchen appliance, passive engagement with a reading light. But it is such a part of our living experience that we just work with it naturally. We turns switches on and off without much thought, we expect appliances will just work for the most part. And there are standards that we take for granted - ask anyone who uses the main bathroom in my house and is completely confused by the lightswitch being outside the door, not inside. It is a system that we directly engage with at such a fundamental level of modern life that we freak out a bit when it is different, it gets shut off, or we contemplate life without it. 

In short, it is analagous to UX in software. 

Plumbing has some similarities - it is a system that stems from one input point, out to multiple outputs. But then it gets weird. The first time I replaced a sink and faucet, and looked at two exposed pipes, I had a moment of vertigo as I realized that half the plumbing system is completely disconnected from the other half. The output from a facucet just comes out, and doesn't know or care where it goes. The drain doesn't care where anything comes from, it just collects and moves stuff. And we rely on gravity as the key component of the system. Gravity makes the water flow from the correct output to the correct input. Gravity makes our toilets work, and gravity even provides the pressure that makes the water flow when you open a valve in the first place. 

That is why plumbing is middleware. we're not controlling a large complex system, we're just selectively engaging with it. We are working within a much larger system, and just trusting it to work. (Gravity always works, right? Water has a lifecycle that carries it downhill, then back to the sky, then it falls again to replenish our source.) Plumbing also isn't something we worry about after we use our piece of it. The water just flows away, and the local infrastructure does stuff, eventually handing it off to nature again.

We just take that function, of flowing water, and add a thin layer of control onto it. We direct where it goes for our own needs, with a small amount of UX to interact with it (faucets), and then pass the results on down the line, but without changing the overall flow of the system.

Aside from making up a big analogy, one that could be ripped apart if people so choose... why does this matter to software development?

Because part of our job is to make sure we don't build systems that intertwine in ways that make them impossible to build and maintain. In general, water and electricity don't mix. Neither should the layers and components of systems we write. If you have a resource that you need to work with in small doses, at specific places in your app, write some plumbing/middleware to control your interactions with it. Don't re-invent gravity. Don't try to make water flow alongside your electricity. Likewise, if you are building something that drives the entire experience your users will have with a system, follow standards. Make it intuitive. Make it easy. Don't put lightswitches on hard to reach places far away from the devices they control. Don't leave wires exposed. Do document the system, and label your circuit breakers, so it is easy to fix when things go wrong. 

Different systems will need to be written in different ways, for different purposes. For each component of your sytstem, think about what resource you use, what you are doing with it, and whether or not the resources used have anything to do with each other. Keep unrelated resources separated. Keep resources that are dangerous to each other separated.

Don't pour water into your electrical system.