Implicit type coercion is just bad in general and shouldn't be allowed, that includes booleans. 0 and false are not the same thing even if in memory they (usually) are represented the same. Just because 40 years ago we thought it a good idea doesn't mean we shouldn't improve on that. And I say this as someone who has programmed quite a bit in C and C++.
I could maybe see an argument for optionals but even there I would disagree and much prefer explicit pattern matching or zig style if syntax for it.
35
u/TKristof 16h ago
Implicit type coercion is just bad in general and shouldn't be allowed, that includes booleans. 0 and false are not the same thing even if in memory they (usually) are represented the same. Just because 40 years ago we thought it a good idea doesn't mean we shouldn't improve on that. And I say this as someone who has programmed quite a bit in C and C++.
I could maybe see an argument for optionals but even there I would disagree and much prefer explicit pattern matching or zig style if syntax for it.