Re: A little bit of math



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.)
.



Relevant Pages

  • Re: Two problems sending an E-mail for Outlook 2007 and VB 2005
    ... I'd suspect that you aren't getting a valid Account object, I've used SendUsingAccount with valid Account objects with no problems, although reading that object property only works right in a Send event. ... Dim WordContent As String ... Dim SendPersonName As String ...
    (microsoft.public.outlook.program_vba)
  • Re: Testing Platforms
    ... I think that most of us would just run a separate account on the main ... String "q" ... programming changes relating to data entry screens, report formatting, ... we are current on our support contract) has run hot and cold. ...
    (comp.databases.pick)
  • Re: using multiple locations (network drives) for recorded TV
    ... I have a linksys MCX, ... MCE only needs to continue to record to the standard ... > understand holds more than one string. ... > research I found implied you need to do this for the SYSTEM account not ...
    (microsoft.public.windows.mediacenter)
  • Re: TrueCrypt & user Rights
    ... He'll be requesting subject to optimistic Dickie until his string ... We exchange the superb rose. ...
    (sci.crypt)
  • Re: Testing Platforms
    ... I think that most of us would just run a separate account on the main ... String  "q" ... programming changes relating to data entry screens, report formatting, ... we are current on our support contract) has run hot and cold. ...
    (comp.databases.pick)