Hacker News new | ask | show | jobs
by Nycto 3380 days ago
That's not the point. The point is that any safety you think you have by using an Option is a little bit hand-wavy.

That's not _bad_, but the argument being made by the OP was that nullability in Kotlin was unsafe and inconsistent.

1 comments

My argument is that while you use null assignment and nullability in Kotlin, in Scala you don't work with nulls.
If your entire code base is in Kotlin, then nullability works exactly like Options. The difference is sugar. And the Kotlin compiler can handle null checks as well as the Scala compiler handles Options.

The problems arise when you interop with Java. At that point, shit can be null and you just don't know. My point is that it's the same problem in Scala as it is in Kotlin: Java interop adds a measure of unpredictability that needs to be handled at the touch points.

I agree on all these points.