3 ms·
the number 9, is not the same thing as "true". some people may want it to be, it might be convenient for some people if a compiler treats them as the same thing
by svnpenn 4y ago
the number 9, is not the same thing as "true". some people may want it to be, it might be convenient for some people if a compiler treats them as the same thing, but they aren't. In my opinion, its an anti-pattern to have the compiler make these type of decisions. Instead of writing and reading code that is explicit, you're writing an abbreviated version of what you want, and assuming that the compiler will know what you mean.
- samatman 4y agoIt's Go pretending it's a kind of language it isn't, and making the user do the teapot dance instead of cooperating. People keep telling me this koolaid is delicious but I just don't see it.
- svnpenn 4y agoIt seems you ran out of actual arguments, sorry to hear that.
- samatman 4y agoYou can't argue with someone who doesn't understand logic, which is literally true here. I have run out of jokes at Go's expense.
- svnpenn 4y agoI think I made my point known. Converting int to boolean is not a settled task, as different people might not agree on what the correct way is to do that. False could be zero, or negative one, or any negative number, or even one. So its better not to have the compiler make that decision, and just have the code be explicit about what its trying to do.