Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> but in no way were tools breaking any sort of promise

The Unix philosophy as usually stated includes the rule "write programs that work together".

Most Unix commands don't work together in any meaningful sense. For example, `ps | kill` will not terminate all processes, as one might naively expect.

I'd say this is a clear violation of both the letter and the spirit of the Unix philosophy.



I mean, neither will `ls | rm`, and a myriad of such combinations if you try them blindly, but it's unreasonable to assume that every combination of commands will work in the simplistic way you expect them to.

Tools like xargs exist to fill that void, and it allows the tools themselves to work independently.

Developing a set of tools from scratch that share a strict design principle is much easier than enabling an ecosystem of purpose-built tools developed over decades by external contributors to interoperate with each other. Leaving the exchange format open is a reason this still works so well today. Or would you rather use XML or whatever format was popular 40 years ago, have to adopt a new format whenever the previous one becomes outdated, and deal with compatibility hell when tools support different versions of the format?


IMO, it's rather embarrassing how rarely they work together without a decent amount of effort. Especially in light of the fact that, e.g., `ls | rm` does work exactly as expected on Windows nowadays.


> For example, `ps | kill` will not terminate all processes, as one might naively expect.

Who expects it to behave like that? Quite the assumption.

Expecting automagic inference based on typing is building a system based on assumption. Have fun making breaking changes to a foundational component that every command will rely on. Everyone will assume you want typed data and if you don't accept/generate typed data then what? Will every shell program have to be burdened with this nonsense and require a rewrite?

In the end ps does exactly what it was meant to do: print information on processes. Your assumption is missing the step where you extract the necessary information you want, e.g. the pid. That is where unix philosophy comes in. Your assumption also seems to make foot guns easier as ps|kill should not be that easy.


kill `ps`

rm `ls`

kindof work




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: