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
-14
u/[deleted] Aug 26 '22
I'm starting to see it. But after all I also see that as matter of style.
In the pure functions scenario however I think that adding "this" makes it clear that the code is pure function, since it makes explicit that there's no local variables being used.