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

Implying that having null is a good idea at all.



So how would you represent an absence of a value? In an enum that'd be easy, but there is a semantic difference between an empty string and a null string.

Or would you propose sending a boolean to indicate null as well as a string in a data type?


See the Option/Maybe pattern, which uses sum types rather than unions or sentinel values.

https://www.lucidchart.com/techblog/2015/08/31/the-worst-mis...


There is nothing wrong with using null in PHP...




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

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

Search: