3 ms·
> Actually, javascript is the only language that has it right. Not only can anything be null, anything can be undefined I think they are very similar in that t
by cies 6y ago
> Actually, javascript is the only language that has it right. Not only can anything be null, anything can be undefined
I think they are very similar in that there are now 2 nully things to guard for.
Option types suck in Java as they were tagged on later. Maybe in Haskell, or even nicer, Maybe in Elm is were the party's at. It is build in at the center of the language. And getting a value (v) from a list by an index should give you a "Maybe v", as you could be out of bounds. That's the strong typing that basically keeps me safe when viciously attacking a code base I have not touched for some time (or is not written by me to begin with).