Comments intermingled.

Reinier Zwitserloot wrote:
> Why write a style checker to gain the protection of final when you've
> got the keyword?
> 
> 1) Say what you want, but spreading 50 gazillion instances of 'final'
> in your source file is a pretty fundamental source smell. Even if, for
> arguments sake, we all agree that final is just the right way to go,
> then it would STILL be annoying.
> 
You've argued this before, but that kind of code noise is simply par for the 
course for Java.  If 
you don't like it, you're really in the wrong language.  I've listed off a 
bunch of examples in an 
earlier e-mail, which you're welcome to dig back up.  In addition to that list, 
I should add 
getters/setters that do nothing but wrap field access, as well as annotations 
-- those occurred to 
me a bit after I sent the e-mail.

> 2) Because, as we've been going over and over and over again, I
> strongly believe your code is cleaner if you allow modification of
> parameters, but only at the very top of the method. There's no java
> keyword for this in the first place.
> 
Do you have evidence of this?  So far, the only case you've given me where 
there's a substantial 
difference turned out to be 1) easy to work around, and 2) bad coding practice 
which is nicely 
exposed by using the "final" keyword.

> *) I consider any warning rolling out of the build process as
> effectively an error for virtually all intents and purposes, but when
> in doubt, if the compile/build process CAN produce a working build,
> then it should produce it and not just stop.
> 
Whether or not I agree depends on your definition of "working".

At the end of the day, we're basically in agreement -- you're just a fan of 
using the IDE flag or 
some kind of externalized checker to prevent/squeal at parameter assignment, 
whereas I'm an advocate 
of using a keyword to enforce the same behavior.

~~ Robert Fischer.
Grails Training        http://GroovyMag.com/training
Smokejumper Consulting http://SmokejumperIT.com
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to