Re: Try/Catch
- Posted by dcuny Feb 13, 2015
- 4294 views
To nip the flower in the bud:
LOGIC coding is the only way to code faultless from the beginning,
starting with the innermost action first and when that is perfect
proceed to the surrounding condition(s)
That is the way I learned programming back in the 60's and still do.
My code happens to be almost always errorfree because of this approach
No one is arguing this point.
As you note, even your code is only "almost always" error free.
What is being suggested is a mechanism so that users don't suffer potentially catastrophic results for those times when they do encounter exceptions.
The purpose of fail on error has nothing to do with coding "faultless" code. It's there to provide the developer with a mechanism better than "mysterious machine exceptions".
There are no mysterious machine exceptions - you will always get a full English description of any problem that occurs with your program at run-time, along with a call-stack trace-back and a dump of all of your variable values. Programs can be debugged quickly, easily and more thoroughly.
- David