News for hackers. Stuff that matters.
Re:Down the Golang Nil Rabbit Hole by tedunangst on Tuesday March 30, 2021 @12:46AM (#26631338)
Checking for nil in the receiver function feels like an antipattern. Like checking for null this in a c++ function.
Re:Down the Golang Nil Rabbit Hole by morelisp on Tuesday March 30, 2021 @02:34AM (#26631738)
Yes, even when I expect nil receivers because I'm adding a method to a map or slice type, checking for nil is usually the wrong pattern (vs. 2ary lookup or len, etc).