Hacker News new | ask | show | jobs
by aldanor 3947 days ago
That's an interesting claim, care to back it?

P.S. *nix shell != bash, there's zsh and fish that are light years ahead re: tab completion and other general niceties.

3 comments

Powershell data is not just plain-text, it's all objects. On *nix when you run "ls -l" you get text. On powershell when you run "gci" you get objects. But the objects are nicely formatted automatically for you when they hit stdout so it ends up looking the same.

On powershell if I want to find a list of files that are more than 100k in size I can just do "gci | where Length -gt 100000". If I want to see the top 10 processes that have the most handles open I just run "get-process | sort handles -desc | select -first 10". That way of interacting with things extends all the way through every aspect of powershell and it's incredibly potent. If I want to query a bunch of build jobs from a service I can just create a simple couple line script that talks to a web service and returns queries. Then I can use the built in select, where, format, etc. commands to get at the data I want. I can filter by jobs that have failed, I can filter by jobs of a certain type, or that ran on one machine. All of that is basically free on powershell, it's just baked into the way everything works. It saves you from all the ridiculous overhead of using perl, sed, awk, etc. just to get at the data you want.

Aside from that, with powershell you get things like man-page-style help and usage messages, named parameters, parameter type checking, etc. at very low cost, as just the natural way of doing things.

The Unix philosophy has always been about having small tools that you can use together to get big stuff done, powershell very much embodies that philosophy.

And yet scripts for them are still written in a bash-like language for backwards compatibility reasons, which is really a shame in my opinion, because it is not a particularly convenient family of languages.
zsh and fish are mostly interactive shells, are they not? How does your claim of them being ahead in "tab completion and other general niceties" contradict ossreality's claim of PowerShell being superior in "text and object manipulation"?