3 ms·
I'm in the same boat. I'd really love to see something that's a little bit more beginner friendly than Hoogle. It's honestly why I think avoiding operator over
by akhilcacharya 8y ago
I'm in the same boat. I'd really love to see something that's a little bit more beginner friendly than Hoogle.
It's honestly why I think avoiding operator overloading in Java/Go etc was a great idea.
- timjver 8y agoIsn't operator overloading something else than the ability to define custom operators?
- btilly 8y agoWhat people do in practice with operator overloading is turn regular operators into custom operators that do something different. Your ability to customize behavior is not as extreme as being able to make any custom operators that you want. But the tradeoffs are definitely related.
- seanmcdirmid 8y agoC# supports operator overloading but not custom operators. That means vectors get to use the plus operator for addition, but no Scalaesque ~~/ operators. C# is not a language that is generally criticized for operator soup like the ones that support custom operators.
- ainar-g 8y agoCounter-examples: * C++ uses bitshift operators for IO. The (in?)famous std::cout << "hello world" << std::endl; Which is such an improvement over puts("hello world"); * Ruby on Rails components sometimes redefines `=` as a hash merge. E.g. this config.action_mailer.default_options = {from: 'no-reply@example.com'} actually adds `from` to the default options instead of overriding it completely.
- btilly 8y agoC# may not be generally criticized for that. But there are certainly C# code bases that do get so criticized.
- jcelerier 8y agostrong disagree, looking up what an operator does takes 5 seconds of reading the doc - if it's a notation that you don't already know -, but the benefits when writing the code are immense.