Re:Nil in Go is typed in theory and sort of untyped in practice
by masklinn on Wednesday March 31, 2021 @03:49PM
(#26652187)
First, your comment makes no sense:
a = 1
b = 2
c = 1
a == b => false
b == c => false
a == c => true
Is that surprising? Equality is transitive, inequality is not.
Second, if you have to reach for old javascript "features" (or got forbid PHP) to defend a language you're in a bad, bad place.
Third, the broken equality is not something that's usually praised about javascript. In fact the first rule of javascript equality is that there is only one situation in which `==` is the correct operator: checking that something is null (because that avoids having to differentiate between null and undefined, papering over one javascript wart using another). In every other situation you want "strict" (===) equality.
Second, if you have to reach for old javascript "features" (or got forbid PHP) to defend a language you're in a bad, bad place.
Third, the broken equality is not something that's usually praised about javascript. In fact the first rule of javascript equality is that there is only one situation in which `==` is the correct operator: checking that something is null (because that avoids having to differentiate between null and undefined, papering over one javascript wart using another). In every other situation you want "strict" (===) equality.