Hacker News new | past | comments | ask | show | jobs | submit login

non-nullable*, Swift calls them optional types I believe. They use the same syntax for it, if you want your type to include "bottom" you add a ?

In Kotlin/Swift by default all types do not include "bottom" or "null". You add a ? to the type to indicate you may use that value, then the compiler will validate you're checking for the existence of null before you use the type.

It's one approach... I prefer the Haskell approach with a simple Maybe/Option type.




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

Search: