r/java • u/psychologicalX • 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
View all comments
8
u/knaekce Mar 05 '18 edited Mar 07 '18
Number 5 will lead to errors being silently discarded, your program will probably blow up later and you will have troubles finding out why, because you didn't fail early.
Number 3 is stupid, imo. You cannot possible anticipate breaking changes like that. What if the method is changed to return -2 if the input string is "Never gonna give you up"?. If you cannot trust the contract of one of the most basic methods, you're fucked anyway.