r/programming • u/[deleted] • Aug 11 '15
Top 10 Useful, Yet Paranoid Java Programming Techniques
http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
28
Upvotes
r/programming • u/[deleted] • Aug 11 '15
1
u/dododge Aug 12 '15
Along these lines, the checkstyle static analyzer has a "design for extension" rule, which requires that all instance methods are final, abstract, or empty. This is useful for ensuring that any meaningful concrete methods don't get shadowed, while still allowing for overrides and inheritance when it's explicitly intended. When I first started using it, it did take a while to get the "final"s in place to get all the warnings to stop, but now I mark most things final without even having to think about it (and even before I started doing Java regularly, my C code was likewise covered in "const" qualifiers).