3 ms·
That's not what parent said. You can express your maths as function calls. Operator overloading is often misused and violates the principle of minimal surprise
by dullgiulio 8y ago
That's not what parent said. You can express your maths as function calls.
Operator overloading is often misused and violates the principle of minimal surprise. You could even have side effects.
Still, type safety is totally possible. In Go, of your unit is Feet, you wrap your int into Feet and you cannot sum it with anything but feet. And that's all compile time, no cost.
- dagenix 8y agoRegardless of if comex's comment was fully accurate, I was mostly responding to "Most languages survived without that" which isn't productive.