News for hackers. Stuff that matters.
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.

Re:Nil in Go is typed in theory and sort of untyped in practice by virtue3 on Wednesday March 31, 2021 @05:31PM (#26653425)
I managed to get my team to use `lodash.isNil` because we had gotten bitten by this crap too many times. And `lodash.isEmpty` for strings/arrays/etc.