News for hackers. Stuff that matters.
Re:Decoded: GNU Coreutils by moomin on Saturday September 09, 2023 @06:29AM (#37443860)
I mean, yes, go has proper flag parsing as part of the standard library and C doesn’t. Yes that’s going to make a line count difference but it’s also why code golf arguments are pointless.
Re:Decoded: GNU Coreutils by 38 on Saturday September 09, 2023 @08:36AM (#37444608)
> go has proper flag parsing as part of the standard library and C doesn’t

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.

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.
Re:Decoded: GNU Coreutils by 38 on Saturday September 09, 2023 @09:19AM (#37445034)
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.
Re:Decoded: GNU Coreutils by 38 on Saturday September 09, 2023 @09:37AM (#37445254)
OK I am waiting...
Re:Decoded: GNU Coreutils by moomin on Saturday September 09, 2023 @05:18PM (#37450387)
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.