Hacker News new | ask | show | jobs
by JdeBP 357 days ago
I've seen both, over the years; programs that have shims, and programs whose checks are ridiculous because they'll just fail at compile time if the standard language feature they are checking for is not there.

But a lot of the time this isn't because people are afraid to take the checks out. It's because they were put in by cargo cult programming in the first place. Autotools et al. are so complex that people will copy existing setups to start new projects rather than begin with a blank slate and add things as and when they come up.

Which means that projects don't start out massively portable because of this stuff being used; but rather they start out inherently massively portable, with useless checks, parroted from somewhere else, on standard library stuff that was always there, sometimes decades before the project was even begun.

It's not really "Who knows". We actually do know. Well, those of us who lived through the process know. Checks for <stdlib.h> or <string.h> aren't needed. There was a period of about half a decade when they were, but by the early to middle 1990s it was perfectly adequate to just assume this pretty basic level of standard conformance.

The "old systems" argument is a specious one. I've worked on the old systems when they weren't nearly so old, including things like porting from Unix to MS-DOS and Big Iron, and experience teaches that the existence of standard headers like <string.h> et al., quickly adopted as soon as they were invented and solved by the likes of Henry Spencer for the rare non-adoption cases, was never a long-term problem; certainly not one long-term enough that it has lasted until 2025.

1 comments

> It's not really "Who knows". We actually do know.

I'm not so sure about that to be honest. A few years ago (around 2020 or 2021 IIRC) autotools switched from the old deprecated backquotes to $(..) to run programs in shell, and people complained that it no longer worked with their SunOS shell or some such. I've also seen some Vim bug reports about stuff breaking on obscure old systems. In short, I think you may be underestimating the "long tail" of weird/old systems.

Personally, I'd say it's perfectly reasonable to just say "sorry, we're not supporting that any more, you can keep using the existing version" because the number of people doing this seems quite small. But they do seem to exist.