2 ms·
> Interacting with objects instead of text is definitely a huge plus. It's a huge minus. The fact that all shell tools produce text is a basic tenet of shell p
by einpoklum 4y ago
> Interacting with objects instead of text is definitely a huge plus.
It's a huge minus. The fact that all shell tools produce text is a basic tenet of shell programming which underlies the composability and interoperability of them all.
> the main benefit of bash is the portability
No, see above. Also, you probably mean ubiquity rather than portability.
> If you spend most of your time in the Windows ecosystem, then there's no reason not to learn it.
The reason is that it will make you only work with other tools by Microsoft, or at best some Microsoft-centric companies which write such tools. Those tools might gain some benefit from working with non-textual objects, but the detriment in variety and composability (even ignoring multi-platform work) is massive.
Another detriment would be how it's non-shell-like work. Part of the idea of shell scripting is that it's work that you might have done "yourself", manually, manipulating the text. With something like PowerShell - you need a debugger, data viewers etc. In fact, one could argue that PowerShell is barely a shell.
- popinman322 4y ago> It's a huge minus. The fact that all shell tools produce text is a basic tenet of shell programming which underlies the composability and interoperability of them all. PowerShell is essentially a cut down .NET environment with some nice syntax-sugar for typical shell activities. The objects in PowerShell are marshalled to/from text the same as in any other programming language. So you can still write your tools as normal. Any PowerShell specific objects would just be a wrapper, or extra metadata. If we're being honest we already have that for other shells to make them more convenient: autocompletions. PowerShell objects give you autocompletions, type information, and interoperability with .NET libraries _but for data in addition to commands_. The shell to programming language continuum has enough space to permit richer interpretations of the base data tools emit. We don't lose composability. > With something like PowerShell - you need a debugger, data viewers etc. Oh, what I would give for better shell script debugging. This is right up there with better CMake debugging for me.