3 ms·
Somewhere I ran across the idea that programs should distinguish between errors and apologies in their messaging. An error indicates the user's fault: they nee
by 082349872349872 2y ago
Somewhere I ran across the idea that programs should distinguish between errors and apologies in their messaging.
An error indicates the user's fault: they need to correct their input before retrying.
An apology indicates the program's fault: either logic for what had been incorrectly thought to be a rare^2 case is missing, or the program has only been configured to deal with N foos, and the user's input requires more. In the former case, the user needs to get a programmer fix before retrying, but in the latter, maybe they can just reconfigure and rebuild (even better, restart with different env vars?) then retry.
The relevant point of this is that when the user is likely to be another programmer, "reconfigure" can be as simple as editing a static allocation.
- jstimpfle 2y agoI like the idea of "apologies" -- sometimes the best thing a program can do is to try, and if it doesn't work then re-try, maybe with a small change guided by the user. However, many programs require a bit more planning how to deal with unfortunate situations, at least without entirely restarting. It's good to not prevent repairing an unfortunate situation from the start by baking in certain constants that can't be practically assumed. Better than editing a static allocation, is if the program can cope with that situation automatically in some way. Next better thing, have it runtime configurable (e.g. command line arguments, no recompilation needed). I don't see a huge benefit to prefer global arrays over memory maps generally.
- Deukhoofd 2y agoIsn't that basically the distinction in HTTP error codes? The 4xx range indicates the user did something wrong, the 5xx indicates the program did something wrong.