3 ms·
> And then when it goes wrong you're violating array bounds which is a crashable offense. Why is this a crashable offense? Probably a bit naive as a C# applica
by LeifCarrotson 9y ago
> And then when it goes wrong you're violating array bounds which is a crashable offense.
Why is this a crashable offense? Probably a bit naive as a C# application developer, not a system developer, but shouldn't all this code be in the equivalent of a try/catch? If it throws an out-of-bounds error, just log the error and return, rendering what you've got.
- Manishearth 9y agoSystems languages like C++ and C don't usually do error handling that way. You do have try/catch in C++ but folks often disable it. And even if you don't disable it, out of bounds array access will cause segfaults, not exceptions (unless you're using some abstraction over arrays).