3 ms·
I was too rash with my comment. Indeed, string + string is also quite intuitive.
by powersnail 5y ago
I was too rash with my comment. Indeed, string + string is also quite intuitive.
- dataflow 5y agoHaha no worries. I think there are more cases outside (what ordinary folks would call) "math", where infix operators make sense; they're just not as common or obvious. Like one example is when you want to build expression trees; you're not actually doing math there, but merely creating a representation of the very expressions you're writing. Another one is &, |, ^, ~ for enum flags (which you can define bitwise so it's "math" in that sense, but which you might want more domain-specific logic for). Another one is overloading <, =, > for arbitrary objects. And so on. I think the real rule is "it should be intuitive rather than confusing". :-)