On Fri, Nov 16, 2012 at 9:27 AM, tamouse mailing lists <[email protected]> wrote:
> Is this a good way to use exceptions? Having an insufficent balance > might be something the user finds exceptional, but I'd think it would > be a standard sort of handling for a bank applicaion... Depends on how you implement it: if you have the option to query the current balance and define that a withraw operation is only allowed with sufficient funds then you throw an exception. If OTOH you define that withdraw will return success then you have a boolean return value. Both approaches are legal and feasible. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
