3 ms·
Javascript has both null and undefined and I'm not sure that's a good idea. At least in SQL we only have one of them, but it can mean unknown or it can mean N/A
by dominicrose 2y ago
Javascript has both null and undefined and I'm not sure that's a good idea.
At least in SQL we only have one of them, but it can mean unknown or it can mean N/A or even false. It's like a joker, what it means depends on how you use it.
- hun3 2y agoOr VBA, which has Empty, Null, and Nothing: https://excelbaby.com/learn/the-difference-between-empty-null-and-nothing-in-vba/ https://excelbaby.com/learn/the-difference-between-empty-nul... (and sometimes Missing)
- hobs 2y agoNo, it's not those other things, that's just using the tool incorrectly. A NULL is definitely "we dont know", not false, not N/A, especially not any known value.
- swiftcoder 2y agoExcept in every other programming language with a null, null is the definite absence of something
- hobs 2y agoSure, and we're talking about SQL nulls in this context, which is why I am strict in my definition.
- dominicrose 2y agoYes and I think that Clojure handles nil pretty well, and it's a functional programming language like SQL. It's also interesting to see that Typescript has added an unknown type. So something that's a value in SQL (null being unknown) is a type in TS.