Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Which language has both a "None" and "null"?


Scala, as I recall. It encourages using Options (Some/None), but since it runs on the JVM and will often interop with Java libraries, you can also have nulls.

Not exactly a language design, but an unfortunate reality.


Oh no! Does it not have a type for NonNull references, like Rust does?


Since Scala 3, it can have total static analysis where nulls become a separate type that has to be explicitly declared in type signatures.

So, yes.


javascript, at least, has "undefined" and "null", an infuriating duality of falsiness. PHP also has a notion of not being set as well as being set but null.


JavaScript is what we are talking about in this thread, making the point that JavaScript is similar to JavaScript does not help ;-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: