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.

9

u/youguess Mar 05 '18

I personally hate yoda speak as I have to mentally rework the statement in my head

I like languages which read like normal English (python eg, go to a certain extent) and this breaks the flow horribly in my opinion

15

u/NovaX Mar 05 '18

I use Objects.equals(str, "abc") instead (JDK's, formally Guava's, and Commons' prior). Now that its in the language, I don't see a reason to use the older convention.

2

u/defnull Mar 05 '18

Trivial methods like Objects.equals() are inlined anyway, so there is really no real drawback. I have a Utils class full of these.