The Unix way and integration complexity
Over the decades I’ve seen the praise and critique of the "Unix way". I don’t remember reading about the aspect I’ll describe below. This might be a banality, and I haven’t invested much thought into it either. I’m just curious to hear your opinions.
At the core of the Unix way is that tools should do just one thing. Users very often need results that can only be achieved after doing several things. With only single-purpose tools at hand, users have to integrate them. In other words, the tool authors delegate integration to the users.
Here’s the idea I want to discuss. In programming languages, integrating various modules to achieve a goal is already a complex task because we often have to handle numerous failure modes and edge cases. In shell scripts this is much worse, since shells are more limited than programming languages. Writing a tool that does only one thing looks like avoiding the most complicated task. Which leads to a conclusion that the Unix way only works well in a rather small fraction of use cases; the majority of cases are better served by different approaches.
What do you think?


hendrik
in reply to arty • • •arty
in reply to hendrik • • •hendrik
in reply to arty • • •arty
in reply to hendrik • • •novafunc
in reply to arty • • •And generally should be more efficient too. Bash and this unix-style tool calling was not designed for efficiency. Which is fine for most use cases, but should be avoided for tools you regular use.
To be more detailed, every time you call a program using bash, your bash program has to fork into two identical processes. Then all that work of forking is wasting as one of the forks then execs to replace itself with the program you called. And that happens with each tool called.
Using other programs, like Python, can more efficiently exec other programs without the same overhead of forking. And for longer running jobs, Python is much more efficient as it converts itself to bytecode, whereas bash is purely interpreted.
The main downside of Python is its longer time to start. So for simpler jobs, bash can be better.
brainwashed
in reply to arty • • •I think the Unix way is a great ideal if you develop composable cli tools, functions or libraries. In each its easier to reason and recombine a thing, that does one specific thing. More complex user problems are then solved by combining multiple simpler components. Lots of modern graphical user interfaces neither think about what the user might want to do, just offering everything, nor prescribe a specific workflow, which just leaves users that have a only a vague idea of what they want to do or a porgram could do, confused.
Being more unixy would be great for mobile apps as well. iOS for example has these app shortcuts which expose functionality of an app to be combined with other apps featuers. I think once siri AI takes hold this could be done. I think, however, the monetization realities of most software will always pressure them to do lots of things and lock the user in.
Use Apple Intelligence in Shortcuts on iPhone or iPad
Apple Supportarty
in reply to brainwashed • • •What I am trying to say is that this solution is very likely to be poor, not taking into account various failures and edge cases.
banana_pie
in reply to arty • • •hendrik
in reply to banana_pie • • •arty
in reply to banana_pie • • •TrollAccount69
in reply to arty • • •The Unix way isn’t for people who can’t integrate those tools.
Ever been in the drivers seat of an 18 wheeler? Even just getting into one requires more physical exertion than getting into your car. When you’re up there you have a million gauges and controls meant to provide the operator the tools they need for any situation they might encounter and to interface with a galaxy of stuff that can be hooked up to the back. You need a special license which encapsulates this different paradigm of use, operating a gigantic vehicle under much different and more variable conditions than the everyday driver (in addition to approaching normal road conditions and functions like turning left with a different outlook and awareness).
It’s why I often tell people not to switch to Linux. It’s not for them.
arty
in reply to TrollAccount69 • • •