ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: final keyword WAS [Patch] style of UpToDate
Date Thu, 02 Dec 2004 18:05:30 GMT
> From: Matt Benson [] 
> --- Phil Weighill-Smith
> <> wrote:
> > I personally think the use of "final" for method
> > parameters is "a good
> > thing" - it reminds me of that great C++ feature
> > "const" (which was
> > actually far more sophisticated and useful, and
> > strangely is a Java
> > reserved keyword).
> I read the sample chapter Kevin pointed out, and I
> understood the points made.  But if you look at the
> issue from a different perspective, the basic
> take-away message is that "final" should be used as a
> crutch.  The obvious response to that statement is
> then "what's wrong with that?"  Nothing, I suppose,
> but there is unit testing to help avoid the kinds of
> mistakes warned against in the chapter.  I suppose
> it's all a matter of taste.  The
> compiler-optimization-based conditional compilation
> was interesting, but personally I would rather be able
> to throw switches without touching java code.

For more good and fashionable writing test cases can be.
There is no better way to remove the posibility of bug, than having
the compiler semantically verify what was written.

If people think otherwise, then maybe they should try writing all
your parameters as type Object and make the testcases check that you
are doing the right thing on every case. ;-)

The more the compiler can check for you the better.

Jose Alberto

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message