3 ms·
This is a well-known problem of Unix (and software in general) - the original tools have suffered 'feature creep' and expanded far beyond their original intende
by NackerHughes 4y ago
This is a well-known problem of Unix (and software in general) - the original tools have suffered 'feature creep' and expanded far beyond their original intended capabilities.
Discussed here on the venerable cat-v website, which is itself named after this very phenomenon: http://harmful.cat-v.org/cat-v/ http://harmful.cat-v.org/cat-v/
It's difficult to know where/when to draw the line though. I went through a phase of being a massive Unix fanboy but found that if you follow the philosophy too strictly, you end up with a tonne of disparate 'tools' that you have to string together several of just to do anything useful. If you have a script that e.g. loops over a list of files, you might have to spawn a large number of processes for every single item in the list, for functionality that feels like it should be built into one program (but if you add one extra feature behind a flag, then there's no reason we shouldn't add another little extra feature behind a flag, and that's how feature creep happens!).
Not only that, but once you start stringing together various Unix utilities, the expected output of each becomes set in stone (even if the output is just a single line of tab-separated numbers with no obvious meaning, e.g. `wc`). Plain text can be a lot more fragile than Unix fans would like to admit. You could add an option to a program to present the output in a different/better format if needed, but then that's another flaggie that could be better handled by a separate utility... (e.g. instead of an 'output as json' flag, why not have a 'convert input to json' utility that we can pipe the output through?)
In time, I've come to use a mix of single-purpose Unix tools with all their assorted flags, along with monolithic one-man-band tools (e.g. `find` - I have very little trust in piping things through xargs sh -c "run two commands on \"\$filename\" and please don"'"'"t fuck up quotes in \"\$filename\"" - or is it {}? or "{}"? or \"{}\"? or \{\}? You get the picture). Piping stuff together is good for when you're writing shell one-liners and making it up as you go along / as needed, but for anything more than that where a script file is needed, these days I'm more inclined to rewrite it in a 'kitchen sink' language such as PHP or Perl.