in reply to Re: Re2: Learning how to use the Error module by example
in thread Learning how to use the Error module by example
The first example, to me, is an example of how not to use try-catch. To me, you shouldn't be doing a return 0 within a catch. You should be rethrowing some error after doing what you needed to do. The only return statement should be as a result of success. Regardless of memory leaks, that's just poor practice.
The second method ... the closure concern is a bit harsher for me. Matts does provide a solution for it, but I don't like it as it removes the major benefit imho, which is the syntactic sugar. I'll have to think about it and see whether it has a good workaround.
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Learning how to use the Error module by example
by adrianh (Chancellor) on Jul 29, 2003 at 20:40 UTC | |
by dragonchild (Archbishop) on Jul 30, 2003 at 13:30 UTC | |
by adrianh (Chancellor) on Jul 30, 2003 at 13:50 UTC | |
by dragonchild (Archbishop) on Jul 30, 2003 at 14:15 UTC | |
by adrianh (Chancellor) on Jul 30, 2003 at 15:20 UTC | |
| |
Re: Re4: Learning how to use the Error module by example
by perrin (Chancellor) on Jul 29, 2003 at 18:05 UTC |