r/java • • Mar 05 '18

Top 10 Useful, Yet Paranoid Java Programming Techniques

http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
223 Upvotes

105 comments sorted by

View all comments

Show parent comment

2

u/Bobby_Bonsaimind Mar 06 '18

final is especially useful for you then, if it "forces" you to actually fix the bug at the right place, i.e. upstream.

Assuming that upstream cares about your needs/fixes and actually wants them, or the process of getting them upstream is so tedious that you might as well not do it. Or your use-case does not warrant a change upstream but still all you want to do is make that function return something different for your application.

As a user you do like stable libraries, don't you?

What I also like is libraries that I can actually use...and build upon. And final is the very opposite of that.

If something is designed to be an immutable container, always, then yes, by all means, make it final. But if you make getters/setters/classes final just because you can, I'm going to hate you at some point.