If you program systems than you get bugs because of corner cases that you don’t anticipate. You need domain knowledge to know all the corner cases.
Actually, the proper solution is to practice defensive programming, not trust the user input, and be generous with sanity checks. Failing gracefully is much easier when your software knows it’s not in Kansas any more.
Which sounds nice right up until a production system shuts itself down gracefully a few hours before a daylights saving time switch purely because of tests which turn out to be more picky than the actual thing they’re supposed to be protecting.
Multi-byte characters can do surprising things to scripts designed to truncate logs written by someone who didn’t take into account the maximum size of characters and chinese production server names.
A lot of a programmers day can end up being related to fixing bugs due to incorrect assumptions or failing to take edge cases into account and knowing lots of edge cases and handling a reasonable portion of them right away is far better than making the most restrictive possible assumptions off the bat.
Sometimes it’s the sanity checks themselves which fail to handle input that the system itself could handle fine.
Do you know that “the system” can handle that input fine? If you do, why did you sanity check reject it?
Sanity checks are just code—you certainly can write bad ones. So?
You don’t want to end up running into the Y2Gay problem
That post argues via mind-numbingly stupid strawmen (or should that be strawschemas?). Yes, you should try to be not stupid, most of the time, to the best of your ability. I agree :-/
The whole point of the list is that there are exceptions to rules that most people consider to be true in all cases.
If you program systems than you get bugs because of corner cases that you don’t anticipate. You need domain knowledge to know all the corner cases.
Leap seconds manage to crash real world computer systems because their designers didn’t handle them properly.
You don’t want any software that has a calendar to crash simply because a user asks the system to show september 1752.
Actually, the proper solution is to practice defensive programming, not trust the user input, and be generous with sanity checks. Failing gracefully is much easier when your software knows it’s not in Kansas any more.
Which sounds nice right up until a production system shuts itself down gracefully a few hours before a daylights saving time switch purely because of tests which turn out to be more picky than the actual thing they’re supposed to be protecting.
Multi-byte characters can do surprising things to scripts designed to truncate logs written by someone who didn’t take into account the maximum size of characters and chinese production server names.
A lot of a programmers day can end up being related to fixing bugs due to incorrect assumptions or failing to take edge cases into account and knowing lots of edge cases and handling a reasonable portion of them right away is far better than making the most restrictive possible assumptions off the bat.
You don’t want to end up running into the Y2Gay problem: http://qntm.org/gay
Do you know that “the system” can handle that input fine? If you do, why did you sanity check reject it?
Sanity checks are just code—you certainly can write bad ones. So?
That post argues via mind-numbingly stupid strawmen (or should that be strawschemas?). Yes, you should try to be not stupid, most of the time, to the best of your ability. I agree :-/