|
|
|
|
|
by fargle
2262 days ago
|
|
That presumes, which is always my complaint about this subject, that this is an advantage. I'd say that's what sh, ksh, and bash have over powershell (tm). The problem with pipelines of objects is that it is inherently a more strongly typed, defined, interface. And therefore special-case. Streams of characters is as loosely typed as it gets. And for processing text files and gluing disjointed tools together, it may seem crude, but is very effective. Especially for quick text processing jobs, or automating series of commands. The UNIX shell concept has been honed and refined over 50 years to do exactly what it does, and it does it very well. It is also extremely generic. This choice was on purpose and has stood up well to the test of time. Powershell is somewhat a perl-for-windows-admins. A write only pile of special tools and special cases for the peculiarly baroque system interfaces of that particular OS. Neither better or worse than VBA from what I can tell, just the passing style this decade. |
|
Not true. While I am somewhat of a novice at powershell, I didn't find that to be the case at all.
> Streams of characters is as loosely typed as it gets. And for processing text files and gluing disjointed tools together, it may seem crude, but is very effective. Especially for quick text processing jobs, or automating series of commands.
Well done for the Pavlovian regurgitation of how piping text output is supposed to work.
I don't like working with it. It is okay for small scripts. However if it is mildly complicated I would use something like Python (not powershell).
Powershell is great for small scripts where you need to do sysadmin tasks e.g. I have a script where I setup my SQL Database aliases for development. Piping text about doesn't help me in these sorts of tasks. I need to go "I need to find where the real database is, and then map those properties to an alias". That works better with piping objects. It works kinda like functional concepts such as map(), reduce() etc.
You should use the right tool for the right job.
> The UNIX shell concept has been honed and refined over 50 years to do exactly what it does, and it does it very well. It is also extremely generic. This choice was on purpose and has stood up well to the test of time.
You know not everyone thinks that Unix was the pinnacle of human achievement.