Re: the Linux man-pages as an educational tool

Alejandro Colomar <[email protected]> Sun, 2 Aug 2026 23:34:40 +0200
Newsgroups org.kernel.vger.linux-man
Message-ID <am-2d02e1qq78Asv@devuan>
--oxi5iqsvxt4eseua
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
From: Alejandro Colomar <[email protected]>
To: "Maciej W. Rozycki" <[email protected]>
Cc: Collin Funk <[email protected]>, 
	"G. Branden Robinson" <[email protected]>, Paul Eggert <[email protected]>, [email protected], 
	[email protected], [email protected]
Subject: Re: the Linux man-pages as an educational tool
Message-ID: <am-2d02e1qq78Asv@devuan>
References: <am50AM0bdufHa9W3@devuan>
 <15288158.RDIVbhacDa@cagnes>
 <am56ZBzNM5J07AUa@devuan>
 <[email protected]>
 <am6CnOddgaM10pry@devuan>
 <20260802000833.zpu27l7ibvrbouna@illithid>
 <am6PkypxYg-Fq4Iz@devuan>
 <[email protected]>
 <am6X32HkGdm2xTd7@devuan>
 <[email protected]>
MIME-Version: 1.0
In-Reply-To: <[email protected]>

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=20
> 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

>=20
>   Maciej

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

--oxi5iqsvxt4eseua
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmpvt+oACgkQ64mZXMKQ
wqnsFRAAmh6lhP/G7x0QI9eH97AyMg814jLxZPuaofNbqLhUIoD2vpqjP5HvWlIV
2T0KU54So4Wx6T9gcMwmYo4NbubkyMQknAbTvl14U5/TpiMUydE29PTb4lfKO4m1
kJgwOOoqZEWGUR4HoJ2qoN8KYJ/U/uyeU+Oj6Hsy7TvzDgsg6H8IW3YA8vFSrG4b
wZXqHpzSFOih4AgS7xyaJ3H3xfvMea7nnTFHLD5KW9ecD41Y2mvW6u0NiOLl2jgq
uYKnXiuaRAk5HmUZSDmne2ECC2hCWWjOFdQ/jr/+eNTTOhmA5N9bZP9Rg4uQpGP3
2OjF00lY0t/XVMMaxS8KCs5rKu9iYEij77fsf0h+lw3UgibiwZp75q/Qo9IRdCN1
Az4baWj0Wre0GHf1my44Lq/s8QAlCsnI9+ISoQuMpq9/3yU7Eu0rDVWGnEbXTG0n
0o2q041Hh5GXWlS0vhvJ1PPPaXOx7KX08Hlpmj3de75hiUOJMmBPyIvOihcAhFJY
+eN7L97wGwz20ehjFLujYYphkk7V7HidjvUJH8mReetI8T5+gFgKZ0b7txOOyr9F
+Qbpo79VH7KYQoPCIDMsXere8WtxykkdfqDPIhDtSUsZhqEmWzM0iKzAUiE7HdaH
sDIxkyOJUbAExdVzkgD8cFF+pqdH+MhDV6c0kKPGqiV5GcF8W/U=
=UEWm
-----END PGP SIGNATURE-----

--oxi5iqsvxt4eseua--