in reply to Re7: Learning how to use the Error module by example
in thread Learning how to use the Error module by example
In the find() example, assuming that stored(), next() and first() can throw error exceptions, show me some simpler code using exceptions rather than multiple returns.
I've no objection to using exceptions for non-error conditions. I do it all the time :-)
However, I do have an objection to making my code more complex because of an arbitrary rule. Why should I not use return within a try block when it makes my code far easier to understand and maintain than the alternative? What is the downside?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re9: Learning how to use the Error module by example
by dragonchild (Archbishop) on Jul 30, 2003 at 14:15 UTC | |
by adrianh (Chancellor) on Jul 30, 2003 at 15:20 UTC | |
by dragonchild (Archbishop) on Jul 30, 2003 at 15:38 UTC | |
by adrianh (Chancellor) on Jul 30, 2003 at 15:49 UTC |