4 ms·
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.
by st3fan 6y 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.
- mumblemumble 6y agoSame for Kotlin, really. Can only do so much to stabilize things when you're building your home in a marecage.
- antonvs 6y agoThere 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.
- lemming 6y agoI 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.
- puredanger 6y agoNPEs 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.