4 ms·
Operator overloading is super useful - I help maintain FluentCassandra and we overload the implicit conversion operators to make it seamless to convert from bui
by Aaronontheweb 13y ago
Operator overloading is super useful - I help maintain FluentCassandra and we overload the implicit conversion operators to make it seamless to convert from built-in .NET types and their associated Cassandra types. It makes a MASSIVE impact on the user experience and amount of boilerplate code it eliminates.
- sdegutis 13y agoDoing ObjC for the past 5 years, I jumped on the Apple-fanatic bandwagon and hated loudly on operating overloading. But I really really loved being able to use + on two strings. So much nicer than `[a stringByAppendingString: b]`!
- alkonaut 13y agoOperator overloading is a powerful thing, but C# strikes a balance. It doesn't allow overloading assignment, logical operators and so on. While it should be used carefully, it really makes a difference for scientific types such as vectors. What I find missing from C# in this area is the use of operators in interfaces, which would let you do truly generic things such as make a matrix class that allows any element type that supports addition and multiplication.