Hacker News new | ask | show | jobs
by st3fan 2018 days ago
Clojure has no null safety. You may encounter it less because of the foundational building blocks you use in the language, but NPEs are most certainly there.
2 comments

NPEs exist but I probably go months or even years between encountering them. Most Clojure functions are polymorphic on nil and provide safe default behavior. You primarily encounter them when invoking Java APIs via interop.
Same for Kotlin, really. Can only do so much to stabilize things when you're building your home in a marecage.
There are certainly limits, but null safety doesn't need to be one of them. Typescript does a great job of handling null safety on top of JavaScript.

I don't see any technical reason why Kotlin couldn't have done the same.

I don't see any technical reason why Kotlin couldn't have done the same.

Kotlin does do the same. I totally disagree with GP's assertion that Kotlin has no null safety. I use both Kotlin and Clojure and I find Kotlin much better than either Clojure or Java with respect to NPEs.