LudovicoVan
Posts:
3,007
From:
London
Registered:
2/8/08
|
|
Re: 0^0=1
Posted:
May 6, 2012 12:44 PM
|
|
-- Julio P. Di Egidio Software Analyst Programmer Head of Technical Integrated Payment Solutions LLP http://www.integratedpaymentsolutions.co.uk mailto:julio@integratedpaymentsolutions.co.uk Tel: 0845 468 1168 Mob: 0782 523 2928
"Gus Gassmann" <horand.gassmann@googlemail.com> wrote in message news:634f0df5-687d-41fb-b372-1a37c1b957b1@y17g2000vbn.googlegroups.com... > On May 6, 12:04 pm, "LudovicoVan" <ju...@diegidio.name> wrote: >> "William Hale" <bill...@yahoo.com> wrote in message >> >> news:billh04-C688F1.04503606052012@news.eternal-september.org... >> <snip> >> >> > You have a program that needs to concatenate the first name and last >> > name of a person to obtain the full name. However, some people only >> > have >> > a first name (Cher, Sting, etc). Your suggested program would produce >> > an >> > error message; the programs suggested by others would run ok. >> >> Right, but both programmers would be wrong in presuming that there is a >> correct program behavior other than the one corresponding to the >> customer's >> requirements... > >> There are indeed cases when you do want an exception to be >> raised if the last name is empty. > > That may well be so. However, I submit to you that these are special > cases and should not drive the design of a general-purpose routine.
There is no such thing as a "general-purpose routine". The computer itself is thought of as a general purpose device, yet only in the sense that it can run any (specific) programs.
> Anyone who *needs* the product method to fail on an empty list would > be a fool to rely on the method catching the exception and returning > --- what? You can`t even define it properly. The condition needs to be > caught *outside* of the routine, before the product is ever called.
"Catching exceptions" happens to be a technical term of which you don't seem to know the exact meaning.
-LV
|
|