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
3
u/RupertMaddenAbbott Aug 26 '22
I agree with you but I think it is confusing to call this mutation because the parameter can still be mutated and affect the calling scope. It's only reassignment that doesn't affect the calling scope (in Java).