3 ms·
> Working with text output is easier because it's uniform If it is so uniform, why does every command need a dozen switches for modifying their output? Why do
by AnIdiotOnTheNet 4y ago
> Working with text output is easier because it's uniform
If it is so uniform, why does every command need a dozen switches for modifying their output? Why do we need to use complicated tools like awk to reformat it for input into other commands?
Everything you cite as a problem with structured IO is a problem with text too, it just happens to also suffer from in-band signaling issues and be human readable. Oh and of course it doesn't have a standardized structure at all.
- crabbone 4y ago> If it is so uniform It is uniform. It is an immutable string. > why does every command need a dozen switches for modifying their output? This question is unrelated to uniformity... Depends on the command I guess? Some do, some don't. Another argument is about how much information you want printed... I mean, when you work with SQL clients you don't just select the entire table every time you want to do something with it, but it doesn't mean that tables are unstructured uniform strings... quite the opposite. > Everything you cite as a problem with structured IO is a problem with text too Can you explain this? I don't see the connection. You make no argument to support this what so ever...
- AnIdiotOnTheNet 4y ago> It is uniform. It is an immutable string. PowerShell objects are uniform too then. They're just a blob of binary. > Another argument is about how much information you want printed That's the thing, though, when I'm passing it to another program for further processing that is entirely different than formatting the output. PowerShell has commandlets you tack on the end of a pipeline for formatting the output. In between commands they have standardized objects. > Can you explain this? > Working with hierarchies of objects is a lot more complicated. Hierarchies exist in textural output too! And they are indeed a pain in the ass to deal with. In fact, much more so since they aren't adhering to a standardized structure and use in-band signaling. > The operating system and the programs it runs have to understand structured input and produce structured output. Same with text, it's just that the "structure" is completely ad-hoc with no standardization and using in-band signaling that often requires a lot of error-prone manipulation to adapt between commands.
- crabbone 4y agoNo, PowerShell objects have different types. They are not uniform in the way immutable strings are uniform. You can have type errors in PowerShell because of that, but you cannot have type errors in Shell, because, well, everything is the same type. > Hierarchies exist in textural output too! Dealing with immutable strings instead of hierarchies allows you to ignore the fact that there's a hierarchy encoded in text. Maybe it's there, maybe not. I don't care. My tools allow me not to care. Your's don't. That's the point. > Same with text, it's just that the "structure" No, it's not the same. Read again.
- AnIdiotOnTheNet 4y ago> you cannot have type errors in Shell That anyone is seriously promoting this as a benefit boggles my mind. I don't think we live in the same reality so this discussion is pointless.