Re:My Go Resolutions for 2017
by dilap on Thursday January 19, 2017 @12:12PM
(#13437370)
i think people get so tripped up by this because they expect equational reasoning to work:
a = nil
b = a
// => b == nil, right? but no.
one of the devs on /r/golang posted he wished they had used a different keyword like "unset" to check for an empty interface, which would be much less intuitively confusing.
i agree all languages end up with quirks like this (can't get everything right without really using the language, and by then it's too late!), and in fact go is low on the quirk level in my opinion.
the other one i really wish i could change is that
for i, x := range foo
doesn't give x a new binding each time through the loop. Confusing, and almost never the behavior you want.
i agree all languages end up with quirks like this (can't get everything right without really using the language, and by then it's too late!), and in fact go is low on the quirk level in my opinion.
the other one i really wish i could change is that
doesn't give x a new binding each time through the loop. Confusing, and almost never the behavior you want.