News for hackers. Stuff that matters.
Re:More Dirty Coding Tricks from Game Developers (2010) by LgWoodenBadger on Sunday August 02, 2015 @10:23PM (#9993381)
On the contrary, it buys you much more. The final keyword in Java will result in compilation errors if you fail to assign it a value for all possible branches within its scope. And it's 5 characters to prevent a whole class of errors for free (erroneous assignments to method parameters), so why not do it?

As for "visual noise," I find it helps to highlight variable declarations and results in more readable code, but we're firmly in the personal opinion area here.

Re:More Dirty Coding Tricks from Game Developers (2010) by gamegoblin on Sunday August 02, 2015 @10:57PM (#9993485)
For where we do use it:

* Member variables of a class that should be initialized in the constructor

* Static final constants

* Any configuration-like variable

* Like you mentioned, when you need to initialize a variable in a particular scope, but the initialization could happen in several control paths of inner scopes

Re:More Dirty Coding Tricks from Game Developers (2010) by the_af on Monday August 03, 2015 @12:01AM (#9993711)
And coming full circle with the original question, I'd add:

* Function parameters.

Re-assigning a variable used as a function parameter is frequently a mistake, and almost always makes code more confusing. I find the "this is defined only once in this function" philosophy to be useful in keeping complexity down in Java programs. Even if final doesn't make objects immutable.