From: Chris Cleeland (cleeland_at_[hidden])
Date: 2006-01-13 10:23:29
On Sat, 14 Jan 2006, Christopher Kohlhoff wrote:
> ...for a program to operate correctly it should range-check the values
> before passing them to the constructor.
> If a well-behaved program is going to do that anyway, what is the objection
> to using the exception approach? A well-behaved program will never trigger
> the exception. If you forget to range-check the values then you probably do
> want to know about it.
It seems that throwing the exception follows the principle of "fail early,
and as close to the source of error as possible", which is, IMHO, good. I
say throw the exception.
-- Chris Cleeland, cleeland_c @ ociweb.com, http://www.milodesigns.com/~chris Principal Software Engineer, Object Computing, Inc., +1 314 579 0066 Support Me Supporting Cancer Survivors in Ride for the Roses 2005 >>>>>>>>> Donate at http://www.milodesigns.com/donate <<<<<<<<<