commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: svn commit: r1353140 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Incrementor.java
Date Mon, 25 Jun 2012 10:00:39 GMT
Hello.

> 
> >
> > Exactly: If a user does not care about the callback, he shouldn't even have
> > to look at the second constructor, even less wonder about the consequence of
> > setting it to null.
> >
> Well, it could also be argued that default parameters are *evil* (I do
> think they are), and that explicitly setting a parameter to null
> forces the user to think about his decision. However, our views are
> more on the philosophical plane,

I don't think so. When possible, default values are used to simplify the
user's life. [If you allow many options to be "null", you force the user to
understand all of them before reaching the conclusion that he does not
need them.]
Of course, I agree that sometimes defaults are evil. We've just had such
cases with the "PolynomialFitter" and the tolerances in the convergence
checkers.

In this particular case, it is quite obvious that the counter will generate
an exception when it reached its maximal count. The user should definitely
not have to read the doc for the callback setting functionality when he just
wants to set the maximal count.

> and I think we could argue for ages
> without coming to a conclusion... Therefore...

Maybe... :-)

> >
> > No ticket is necessary (IMHO). I'm fine with just reverting, then adding the
> > precondition block: it will clearly express that a callback *is* necessary.
> > [Thanks for spotting that bug.]
> >
> ... reverted to previous implementation of constructors (with
> additional check for null) in r1353386. Thanks for reviewing this
> commit which was not in line with the remainder of Commons-Math3.
> Please note that at some point, I will have to take a look to
> iterative linear solvers, where (as far as I remember) I allowed the
> specification of a null preconditioner (sorry, sorry, sorry!).

See also my reply to the commit message (about how to signal that "null" is
not allowed as an argument).


Best regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message