(Very Newbie) Problems defining a variable

John Machin sjmachin at lexicon.net
Fri Dec 12 21:26:34 CET 2008


On Dec 13, 6:49 am, "Tim Rowe" <digi... at gmail.com> wrote:
> 2008/12/12 John Machin <sjmac... at lexicon.net>:
>

> > (4) in practice, the "default" action would not be "return 0.0";
> > perhaps something along these lines:
>
> > if balance < -overdraft_limit:
> >   raise Exception(...)
>
> That's more likely to be in the withdrawal routine

You'd certainly hope that this test would appear in the withdrawal
routine.

> (and is probably
> best not handled as an exception, because it's pretty much normal
> flow). If a bank provided a service such as the one implemented by
> this program, there'd be no need for it to know about overdraft limits
> because it's not making actual transactions. Why would they increase
> coupling unneccesarily?

Yeah, you're right, much easier to return 0% interest on a negative
balance [customers happy; no wear and tear on the call centre] and
hope that anomalies are checked somewhere else *and* that somebody #1
is tasked with actioning the anomaly reports and that somebody #2 is
keeping an eye on somebody #1.



More information about the Python-list mailing list