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

52

u/AlainBienvenue Mar 05 '18

Like the author, as someone who has been coding in Java since 1999, I do not see anything wrong or even paranoid with any of these. Just good practices.

7

u/thephotoman Mar 06 '18

Making everything final except interfaces seems extreme: there are cases for abstract base classes. But if it isn’t in either of those categories, finalizing everything is probably correct.

2

u/dpash Mar 06 '18

Ignore the bits in brackets. The relevant bit is outside of it.

Which is why everything that is not explicitly intended for subtyping (i.e. only interfaces) is strictly final.