Re:Decoded: GNU Coreutils
by inferiorhuman on Saturday September 09, 2023 @09:04AM
(#37444895)
Yes takes a single string with no embellishment, and that's what C provides. There's nothing additional to parse. There are no flags, no additional options, nothing else to configure… and that's by design as there's simply no need.
It's a lose for C either way. Either it cant parse flags, or we remove that requirement, and my code goes from 9 lines to 6.
Re:Decoded: GNU Coreutils
by inferiorhuman on Saturday September 09, 2023 @09:34AM
(#37445224)
You can write a perfectly legible 4, 5, or 6 line version in C.
OK I am waiting...
Yeah, but it’s horses for courses. The C version can be deployed in far more places and can be far faster than the Go equivalent. Which is “better” is a contextual judgement call. There’s plenty of weird architectures out there that run C and almost nothing else.
That's the whole point. Every single command line program needs command line parsing. Go helps me get the job done, C forces me to write my own parser, or find some third party one.