Hacker News new | ask | show | jobs
by taeric 1552 days ago
This feels like an odd critique. I would expect that more programs should devote more code to the parts that interact with a user. That is, the size alone isn't much of a signal. Is it?
2 comments

In the sense of the PowerShell engine doing the argument parsing and display formatting for all cmdlets, which is something I think the designers took from VMS shell. That makes for "Don't Repeat Yourself" (one place for all the argument parsing code) and from the user experience side all commands which subscribe to this take parameters in the same way, arguments handled in the same way, with the same common parameters, and support parameter introspection and tab completion, etc. so it can be a more uniform experience.

(Not always great though; I don't know VMS shell but PowerShell cmdlets can still have similar tools taking different parameter names for the same concept, or not working implementing what to do with common parameters, or taking DSLs in strings like WMI Query Language, or taking rather opaque and unique hashtable blobs).

I didn't mention it but powershell was in my mind. powershell format-table in particular. Also there's some guys who are patching linux user space to embed json as output (and the jc wrapper to be able to leverage jq later down the pipe)
The formatting is redundant and should be able externalized. The argparse also deals with the output formatting, hence redundant. Only file spec selection is core to LS.
Redundancy isn't, by itself, a problem. In the case of core utilities, it affords them a level of stability that is just not even attempted in many areas.