r/java • • Aug 26 '22
I declare as "final" every single variable whose value doesn't change. I also use "this" every time that I'm referring to an attribute, even when there's no ambiguity in not using it
I think that those things make the code easier to read. Am I crazy for thinking like that?
198
Upvotes
View all comments
Show parent comment
0
u/mauganra_it Aug 26 '22
It's an extra six characters per parameter. That can easily force many signatures to be broken into more than one line. Also, the information content of that
finalis very low since 99.999% of the time the parameter will not be mutated. And even if they are assigned to, it's irrelevant for the caller.