Friday 20 March 2015

Just One

I was eyeing up the current (and forthcoming) mac laptops the other day, as you do. I was struck by the "one port" fascination. I've yet to buy anything that uses thunderbolt, so the USB-C thing makes no difference to me. But I am struck that that having one port isn't a major leap forward - it just offloads the demultiplexing problem somewhere else.
For instance, as I sit here at my desk my laptop has 5 wires coming out of it: power, ethernet (wireless in my office is variable), backup disk (happens to be old enough for firewire but can use USB), pictures to the monitor and USB to the monitor. Before I wrote this I copied a file to a USB memory stick, in case things aren't as expected where I'm going later. The monitor's USB ports are full too: audio interface, keyboard, mouse and fitbit dongle. I also often plug in a cable to access a phone; my laptop connects to a projector on average once a week.
At home there's a similar story: I've got a backup disk (spot the ex-sysadmin who found time machine over wireless unreliable), an external disk of pictures and music (editing photos is just faster on a wire than a wireless network), an ipod, a camera (memory card or USB), occasional connection to the TV for family streaming, occasional USB stick and power. And with no external screen to act as a hub and moving between rooms with the computer no fixed place for a separate box to demultiplex whichever combination of stuff I'm using.
So, if I got a new laptop, could I make one port work? Probably. Though it would involve spending money on new adapters, maybe hardware and some rechargeable batteries for wireless stuff just to get the current, or equivalent, gadgets connected. Would I gain anything? Not as far as I can see. I'd still have boxes and wires, just slightly rearranged. I don't recall ever thinking "I wish I had fewer sockets on my computer".

Which gets me to the software analogy. Message busses are all very well. I've written and used more than one. But if they're the only way of communicating in the whole system, they bring their own challenges.
Scalability for one.
Fit to function for another. I don't mind having a separate channel for audit logs, or system management. If the bus breaks or load goes up I still want these important functions, without creating headaches for security, priority and API clarity.
Does doing all communications (or persistence) in one way buy me anything? I like reuse and patterns as much as the next OO-person. There are limits to how much complexity I want to put up with and a common approach can reduce both local and system complexity by sharing the overhead. But, increasing system complexity needs this payoff. Some connections are special, some adapters are too expensive.
A fundamental point I make when training people to solve problems is that there are many ways to solve even quite simple problems. Some may be better than others, but the concept of a solution space, where each solution has its own properties, is an important one. If you vary the parameters of the problem you vary the point in the solution space that is the best fit. There may be a solution that is a pretty good fit to many problems, but far from ideal for some cases. Shading the whole of this space with the biggest crayon you can find isn't big or clever.

No comments:

Post a Comment