Re:Ask HN: Why Did Python Win?
by lelanthran on Wednesday August 30, 2023 @01:48AM
(#37318152)
> Go was the first language I used that broke an explicit check for nil/null/None. I had to cast my nil to a different kind of nil in order for the program to run correctly. C/Python/Java/C++ didn't have this issue. Null was always null in each of these languages.
I think it makes sense - a `nonexistent<ThisType>` is different from a `nonexistent<ThatType>`.
In C, Java, C#, C++ and other languages, null/nil is a value. In Go null/nil has a type. Now that I've used Go a little, I actually miss having error messages for certain things, and comparing a `nonexistent<ThatType>` to a `nonexistent<ThisType>` is actually a logic error in my code that I want to be warned about.
I think it makes sense - a `nonexistent<ThisType>` is different from a `nonexistent<ThatType>`.
In C, Java, C#, C++ and other languages, null/nil is a value. In Go null/nil has a type. Now that I've used Go a little, I actually miss having error messages for certain things, and comparing a `nonexistent<ThatType>` to a `nonexistent<ThisType>` is actually a logic error in my code that I want to be warned about.