3 ms·
I've found that the least amount of mental overhead is still achieved by doing all the necessary tests right where the 'useful' code is taking place, raising a
by DeepDuh 14y ago
I've found that the least amount of mental overhead is still achieved by doing all the necessary tests right where the 'useful' code is taking place, raising a standard Exception but with a good error description and doing a Pokemon-catch somewhere in main(). Not good enough for system programming of course, but for everything you want to fail early it's fine.
If we do talk about system programming: Error handling IMO is its main difference to 'other' programming. The necessity of deciding (and in case of security relevant systems testing) for all eventualities is why only veteran programmers should do that job.