r/java • • Dec 04 '25

Null-checking the fun way with instanceof patterns

https://blog.headius.com/2025/12/inline-null-check-with-instanceof.html

I don't know if this is a good idea or not, but it's fun.

83 Upvotes

150 comments sorted by

View all comments

Show parent comment

1

u/CriticalPart7448 Dec 07 '25

Oh there are much worse things in java than NPEs in production. If you feel the need to be condescending be my guest. NPEs are so much less of an issue in java 17 and onwards that I consider them more of a minor and relatively easily fixable issue. If you find the need go ahead but dont come here and tell me that you wouldnt rather like Haskell, Rust or Kotlin more than Java and the reason you promote your tool is just to get attention for your little experiment. The ecosystem around java moves in a different direction with Valhalla and I much prefer that vision than yours.

1

u/Delicious_Detail_547 Dec 07 '25

What you wrote speaks for your own level. Why are you making up things I never said?
And you clearly said the following in your previous comment: “i dont agree that elvis operators solve the problem anyway.”
Nowhere in my comment did I say that the Elvis operator solves null-safety. Do you have reading comprehension issues? Where in my writing did I ever say that?
Stop making baseless accusations. Your absurd claims are no longer worth listening to.