You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two major problems writing Go programs that cause frequent confusion: The so called "nil error" problem (https://go.dev/doc/faq#nil_error), wherein a nil pointer stored in an interface is not equal to nil, even though it seems like it should be; and NaNs going into maps, which complicate matters because they never compare true to one another, violating a number of invariants around map behavior.
I suggest we make both these problems the same, by making an interface holding a nil pointer evaluate to NaN, thus never comparing true and reducing the confusion to a single problem rather than two. To make this easy to understand, we rename the NaN that results be a "not a nil" value, thereby both clarifying and confounding the NaN problem that plagues our world.
The text was updated successfully, but these errors were encountered:
There are two major problems writing Go programs that cause frequent confusion: The so called "nil error" problem (https://go.dev/doc/faq#nil_error), wherein a nil pointer stored in an interface is not equal to nil, even though it seems like it should be; and NaNs going into maps, which complicate matters because they never compare true to one another, violating a number of invariants around map behavior.
I suggest we make both these problems the same, by making an interface holding a nil pointer evaluate to NaN, thus never comparing true and reducing the confusion to a single problem rather than two. To make this easy to understand, we rename the NaN that results be a "not a nil" value, thereby both clarifying and confounding the NaN problem that plagues our world.
The text was updated successfully, but these errors were encountered: