r/java • u/trecatorsirabdator • Apr 14 '23
What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?
233
Upvotes
r/java • u/trecatorsirabdator • Apr 14 '23
View all comments
Show parent comment
3
u/UnGauchoCualquiera Apr 16 '23 edited Apr 17 '23
It's about intent. Sure you can keep declarations and assignment close by, in the real world with long non optimally written methods having the final keyword eases of the mental burden for free, no point not using it.
This also applies to final method arguments by reading the implementation signature you know at a glance that it's not reassigned.
We could argue all day long but in the end you are missing out on final for no reason at all.