in reply to Re: Re: Re: Re: Idomatic Handling of Subroutine Error
in thread Idomatic Handling of Subroutine Error
A function should do one and only one thing, and do it well. It should be simple enough that you can know what's going on simply due to success or failure. Maybe, you need failure to give you more than one option. Hence, the option I suggested above.
Try and refactor your function so that if it succeeds, that's all the info you need. If you cannot, make it into an object similar to what btrott said in direct response to your original node.
------
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re(5): Idomatic Handling of Subroutine Error
by dvergin (Monsignor) on Sep 19, 2001 at 01:24 UTC |