Re: A little bit of math
- From: "Larry W. Virden" <lvirden@xxxxxxxxx>
- Date: Thu, 14 Feb 2008 09:39:52 -0800 (PST)
On Feb 14, 8:50 am, ZB <zbREMOVE_THIS@xxxxxxxxxxxxxxxxxxxx> wrote:
In my opinion, tclsh should just return 0 in any such case, like
above, instead of complaining.
Hmm - so, you would like a banking program, for example, to set your
account to zero rather than generate an error if the person
programming it did the wrong thing?
That doesn't sound too good.
Or perhaps release millions of tons of oil rather than raise an error?
Or send a lunar lander off some strange direction?
Error raising is a valuable thing. Treating nonsense strings as 0 is
not so valuable.
If I should expect an error message, I must check-out the possibility of
string value - and it's almost as declaration, because in such case variable
_must not_ be a string. It can contain only something, which can be seen as
number.
That's called validation. And for programs that actually are expected
to do things important, validation is critical.
Would you want software that runs a heart pace controller to silently
ignore errors? Or a program in your telephone to dial 0 instead of the
number you want if the software has a bug?
Generally, software should be written to do what it is supposed to do.
It should check, at least when a value is obtained, that the value is
in an appropriate range (for instance, you want to make certain that
someone requesting withdrawl from a bank account actually has the
amount of money being requested, or that a program implementing
accelleration control in an automobile handles a request to
accellerate in an appropriate fashion, etc.)
.
- Follow-Ups:
- Re: A little bit of math
- From: ZB
- Re: A little bit of math
- References:
- A little bit of math
- From: ZB
- A little bit of math
- Prev by Date: Re: Java 2D demo & the Tk canvas
- Next by Date: Re: Java 2D demo & the Tk canvas
- Previous by thread: Re: incr (was: Re: A little bit of math)
- Next by thread: Re: A little bit of math
- Index(es):
Relevant Pages
|