3 ms·
I particularly appreciate that as a billion-dollar mistake, Javascript decided to make it twice (null and undefined).
by jfengel 5y ago
I particularly appreciate that as a billion-dollar mistake, Javascript decided to make it twice (null and undefined).
- zwerdlds 5y agoThe question is, what is the order of the mistake. When you have two, is it linear ($2b), quadratic ($1e18), or exponential?
- voobster 5y agoProbably logarithmic due to diminishing returns. Having 20 nullish types isn't much worse than having 2. The biggest difference is going from 0 to 1.
- jka 5y agoThis reminds me of a microquest that I foolishly embarked on during COVID-19 lockdown: There's no standard, widely-accepted way to unambiguously serialize and deserialize nulls within querystrings. JavaScript is perhaps one of the more frequent client languages for that, but Python and many other server-side languages are affected too. Could we do something about that? I liked the look of the proposal at https://github.com/whatwg/url/issues/469 https://github.com/whatwg/url/issues/469 that was working towards this. In short, it provides the ability for "?a&b=" to represent the variable "a" containing null and "b" containing an empty-string.