On Wed, 16 Jul 2003, Rick Measham wrote:

> At 3:42 PM +1000 16/7/03, Iain Truskett wrote:
> >What do people think parsers should return if they can't
> >parse? And what if they do parse, but DateTime doesn't want
> >to create an object of the appropriate specification?
>
> DateTime::Undef :)
>
> If all modules return DateTime::Undef and all modules handle it when
> passed it, then everything flows.

Flows is one word for it.

> If we return undef, then we need to make sure all methods can handle
> undef parameters cleanly. Of course, we really can't do this because:
>       undef->set( day=>$day )
> is an error .. no matter what!
>
> However:
>       $undef = new DateTime::Undef;
>       $undef->set( day=>$day );
> just returns DateTime::Undef;

And this is a good thing because it will induce incredibly mysterious
errors in the end user's code?

Fatal errors are a _good_ thing.  Forging ahead with bad data and _not_
getting errors is a very, very, very bad thing.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to