News for hackers. Stuff that matters.
Re:The Rule of Silence (2006) by emodendroket on Tuesday December 13, 2016 @09:20AM (#13166917)
> The problem is that now simply providing user-friendly output is not enough. For every program or script you throw together you need to provide the text output for the user, and then the type object stream for piping.

In PowerShell if the result of a command is just an object the object is pretty-printed to the console in practice ends up looking pretty much like what a Unix command would have given you.

Re:The Rule of Silence (2006) by chei0iaV on Tuesday December 13, 2016 @10:49AM (#13167638)
With generic pretty-printing, your program output becomes generic.

Compare the output of "df -h" vs the PowerShell equivalent "gdr -psprovider filesystem", for example. One provides the data in dense (easy to follow) rows, while the other spaces it out across the whole screen, leaving large gaps of empty space around some columns while also cutting off data in others. The difference is especially noticeable of you have network shares with long paths.

PowerShell is probably nice for scripting, but I wouldn't want to have it as my shell.

Re:The Rule of Silence (2006) by emodendroket on Tuesday December 13, 2016 @11:02AM (#13167748)
You can pretty easily pass it to select and get just the properties you care about, or you could output to a different format with the various out- commands. I find it pretty good as a shell.
Re:The Rule of Silence (2006) by __jal on Tuesday December 13, 2016 @03:01PM (#13170365)
Options to select output? Sounds like advice from the Rule of Silence.

But.

- People above were just complaining about having to use sed to tweak output. I don't see why they would prefer a built-in filter to an external one. The external filter is far more flexible, and if that isn't enough, you can replace it.

- I'm generally not a fan of applications that tailor their output to what they think the human wants. Unless there is a deeply compelling reason, I want to see the same output on pts/0 as something down the pipeline. The reason for this is that picking up environmental hints to serve as implicit configuration is hacky, subject to error and and can later be the cause of really difficult-to-find bugs.

Perhaps I'm just irredeemably brainwashed. If you like a typed command line, Redmond has your back. For me, wanting types is a signal that I should start considering whatever little shell hack I'm working on complex enough to take it to a language that wasn't designed for ad hoc interactive use.

And at the same time, I really, very much do not want my command line to look like C#.

I get that a lot of folks these days are mostly GUI users who maybe type a little at git or run test suites from the command line, and not much else. I get why things like Powershell are appealing to such folks[1]. But when the command line is your primary interface, strong typing and OO hoop-jumping is huge waste of cognitive energy.

I do feel that Unix, to a first approximation, got the balance somewhere close to right. Loose coupling with lot of shared commonalities instead of a rigid type system and nonexplicit magic works really well for me, and if tighter coupling is a good idea, then I'll build it.

[1] Why they want to radically change the command line instead of using their favorite language to do systems stuff from the comfort of wherever they spend most of their time, I do not get.

Re:The Rule of Silence (2006) by emodendroket on Wednesday December 14, 2016 @03:00PM (#13179157)
I feel compelled to point out, re-reading this, that you've misunderstood. You pass the output to the Select command and indicate the object properties you want; it's not a feature that has to be built in into each command.
Re:The Rule of Silence (2006) by nailer on Wednesday December 14, 2016 @12:12PM (#13177582)
> People above were just complaining about having to use sed to tweak output. I don't see why they would prefer a built-in filter to an external one.

You don't see why someone would prefer 'select' to scraping with grep or awk?

Re:The Rule of Silence (2006) by emodendroket on Tuesday December 13, 2016 @03:38PM (#13170742)
Yeah, wow, all I have to do is write a bunch of regular expressions tailored to the unique output of this command instead of passing in a list of property names. It's so easy.
Re:The Rule of Silence (2006) by dahauns on Tuesday December 13, 2016 @06:26PM (#13172275)
To add to that: a list of property names you don't even have to exactly know beforehand, since the shell can easily deliver you the exact data structure and metadata of any object (cmdlets, parameters, results,...) usable on the shell.

I find the idea baffling that basically having to have the whole syntax tree memorized instead of the shell providing it for me is somehow less of a "waste of cognitive energy".

Re:The Rule of Silence (2006) by emodendroket on Tuesday December 13, 2016 @08:58PM (#13173189)
I really think people are mistaking "I'm not familiar with it" with "it's bad and poorly designed" because they've forgotten what it was like to first use the Unix command line.
Re:The Rule of Silence (2006) by nailer on Wednesday December 14, 2016 @12:19PM (#13177667)
Slightly more readable posh version:

    Get-PSDrive | Where Provider -like '*FileSystem'
Re:The Rule of Silence (2006) by michaelcampbell on Tuesday December 13, 2016 @09:35AM (#13167014)
> in practice ends up looking pretty much like what a Unix command would have given you.

So... no real improvement, then?

Re:The Rule of Silence (2006) by emodendroket on Tuesday December 13, 2016 @09:40AM (#13167057)
The improvement is that piping commands together doesn't require tedious text-munging while the console output looks basically the same. Which I think you could have figured out if you thought a little harder before jumping to snark.