|
|
|
|
|
by wilsonnb3
253 days ago
|
|
Once the program is operating outside of the bounds of the programmers assumption, it’s in an undefined state that may cause a crash to happen at a later point of time in a totally different place. Making the crash happen at the same time and space as the error means you don’t have to trace a later crash back to the root cause. This makes your system much easier to debug at the expense of causing some crashes that other systems might not have. A worthy trade off in the right context. |
|
I could go into many more examples but I hope I am understood. I think these hard-coded definition of ranges at compile time are causes of far more issues than they solve.
Let's take a completely different example: size of a field in a database for a surname. How much is enough? Turns out 128 varchars is not enough, so now they've set it to 2048 (not a project I work(ed) on, but am familiar with). Guess what? Not in our data set, but theoretically, even that is not enough.