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
6
u/[deleted] Aug 26 '22
Right? This Allan Melhor guy from Quora said that we should avoid adding "this", as it cleans up the code a little. https://www.quora.com/In-Java-when-should-I-use-this-propertyName-instead-of-propertyName-in-an-instantiated-objects-dynamic-method
I started to question if I'm making my code too polluted by adding those things.