Re:strcpy: A niche function you don't need
by teknopurge on Friday July 30, 2021 @06:24PM
(#28013168)
BYOH - Bring You Own Handle
The purpose is not to assume what the developer wants, but provide access to all the resources(and manipulation) they need.
If you need guardrails there are 10s of languages designed for specific purposes.
However at some point you realize that there is an optimal and general-enough handle shape that everyone ends up individually re-creating.
You should use a knife that comes with such a handle but gives you the option to take it off when you want to impress your friends with your knife-juggling skills and feel you have a few fingers too many.
Before C was born, developers were using system programming languages with handles just fine.
C lacks a handle because its designers didn't care to provide one, it is after all based on a language whose main purpose was to Bootstrap CPL.
Re:strcpy: A niche function you don't need
by hiccuphippo on Friday July 30, 2021 @07:16PM
(#28013587)
FWIW, Zig is as sharp as C but with a handle.
Why should you pick Zig and not Rust, D or Go?
Yes, they should. Or several other things depending on what exactly they need.
> C is a sharp knife with no handle; this is it's purpose as a language and tool.
Help me out here HN resident survivalists, carpenters, maybe circus knife throwers. What is the "purpose" of a "sharp knife with no handle" exactly? How often have you thought, "Man, it'd be so much easier to gather firewood, carve decorations or score a bullseye if only the blade would sink into my own flesh while I was using it because it doesn't have a handle" ?
Historically the argument was, "We're using C because alternatives like Java or Python or whatever aren't fast enough or capable enough". OK. But, somewhere in the last few years it moved to, "We're using C because alternatives aren't dangerous enough" and that's crazy.