Hi Maciej,

> Date: 2026-08-02 22:23:36+0100
> From: "Maciej W. Rozycki" <[email protected]>
>
> What problem are you trying to fix anyway, what's wrong with 
> using <string.h> for the APIs in question?

Programmers misunderstand these functions (some more than others), and
think they are appropriate for handling strings in ways that they are
inappropriate.

If <string.h> was described as providing functions that exclusively
handle strings, then programmers that only need to handle strings would
naturally self-limit to functions from this header file.

Those programmers that need more niche memory functions --maybe because
they need to handle a substring, or maybe because they need to handle
a utmp(5) fixed-width null-padded character array-- can resort to
<memory.h>, but that comes with the implied warning that those functions
are not the simple interfaces that <string.h> probides; they are
sharper: you can do more with them, but you need to be more careful.

Most programmers can live in the safe bubble of <string.h>: those
functions always require a string as input, and always provide a string
as output.  Plain and simple.  It's difficult to write bugs when using
those.

That's the rationale.


Have a lovely night!
Alex

> 
>   Maciej

-- 
<https://www.alejandro-colomar.es>

Attachment: signature.asc
Description: PGP signature

Reply via email to