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

> There's really no reason why Go sholdn't have nullable types.

Don't you mean non-nullable types? Go does have nullable types, everything is nullable.

The blog post you linked calls them "non-nil types".




“Nullable types” is a phenomenon that occurs when non-nullable types are introduced to a language that started with null and already has libraries that rely on it. When you change the default to be non-nullable, you have to introduce the explicit concept of nullability for backwards compatibility, thus “nullable types”.

Like, if you already had type X that could be null, and you change the language so X can’t be null, now you need the type Nullable<X> (often written something like X?) to let it be null again.

C# and Swift are examples of this evolutionary process.


Yea, non-nullable types. Thanks.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: