4 ms·
That's true, we should get rid of operators for primitives too.
by anonymoushn 3y ago
That's true, we should get rid of operators for primitives too.
- campbel 3y agoOperators for primitive types are fine, they are well defined by the language and consistent across programs. Operator overloading is going to change behavior between programs which puts extra cognitive load on the reader. That said, Go sticks to the most basic operator implementation (strings, numbers etc...). Go doesn't support `+` on slices for instance.
- coldtea 3y agoIn better languages they don't exist except as sugar, they're functions themselves.