Click here to Skip to main content
15,938,848 members
Home / Discussions / C#
   

C#

 
GeneralRe: Operator overloading, when to Pin
David198718-Apr-11 19:33
David198718-Apr-11 19:33 
GeneralRe: Operator overloading, when to Pin
jschell19-Apr-11 8:48
jschell19-Apr-11 8:48 
GeneralRe: Operator overloading, when to Pin
David198719-Apr-11 9:18
David198719-Apr-11 9:18 
GeneralRe: Operator overloading, when to Pin
jschell20-Apr-11 7:44
jschell20-Apr-11 7:44 
GeneralRe: Operator overloading, when to Pin
David198719-Apr-11 9:54
David198719-Apr-11 9:54 
GeneralRe: Operator overloading, when to Pin
jschell20-Apr-11 7:47
jschell20-Apr-11 7:47 
GeneralRe: Operator overloading, when to Pin
David198714-Apr-11 10:01
David198714-Apr-11 10:01 
GeneralRe: Operator overloading, when to Pin
jschell15-Apr-11 8:52
jschell15-Apr-11 8:52 
David1987 wrote:
Not sure what world you're living in. Every time a vector or a int128 (or larger) is needed, Java will make your life a hell by insisting on manual cloning and writing verbose a.Multiply(b) and the like, for no reason other than that operator overloading can and is abused. Frankly it's none of their busyness whether I choose to abuse their language or not.


Presumably you mean 'vector' in terms of mathematics and not in terms of the java class.

Based on that, the point is meaningless. In terms of lines of code in the world the code that requires vectors is so small as to be unmeasurable.

David1987 wrote:
But then again maybe you're working for some boring company just maintaining even more boring applications (as they call them, versus actual programs) - you know, the kind of program that doesn't actually do anything but just glues some stuff together


Not sure what that means but most of the applications I write do glue things together. And they also make a lot of money both directly and indirectly.

I will admit that getting a regular paycheck and being able to pay bills is in fact 'boring' compared to the alternative. Applications that make money lead to that sort of boredom.

David1987 wrote:
Of course it isn't. I was referring to overloading methods in Java, which you can do accidentally because it doesn't require any syntax. It also will happen sooner or later and that's a nasty bug which is hard to find.


I don't recall it happening to me. I do recall hundreds, thousands, perhaps hundreds of thousands of logic errors of which many are in fact hard to diagnose and sometimes very hard to solve. So I suspect the one of which you speak is lost in the noise.

David1987 wrote:
People will do it, on purpose too. So lets ban virtual methods.


I haven't seen many problems with that in java. I can't recall any. I saw more of that sort of problem in C++ with people not understanding such things as the role of a virtual dtor.

And working around the lack of virtual methods can be done but is much harder.

David1987 wrote:
In fact, let's ban strings and IO and arrays and dictionaries and floating point numbers and abstract classes and definitely reflection, all of which are frequently abused.


Which again ignores my point.

Operator overloading is often misused. And misused despite there being alternatives.

That isn't true for your examples.
1. Situations exist which those are the only solution. And alternatives are hard or impossible.
2. The incorrect usage compared to correct usage is much more reasonable than versus operator overloading.
GeneralRe: Operator overloading, when to Pin
David198715-Apr-11 9:14
David198715-Apr-11 9:14 
GeneralRe: Operator overloading, when to Pin
jschell16-Apr-11 11:05
jschell16-Apr-11 11:05 
GeneralRe: Operator overloading, when to Pin
David198716-Apr-11 20:10
David198716-Apr-11 20:10 
GeneralRe: Operator overloading, when to Pin
jschell18-Apr-11 9:04
jschell18-Apr-11 9:04 
GeneralRe: Operator overloading, when to Pin
David198718-Apr-11 19:30
David198718-Apr-11 19:30 
GeneralRe: Operator overloading, when to Pin
jschell19-Apr-11 8:44
jschell19-Apr-11 8:44 
GeneralRe: Operator overloading, when to Pin
David198719-Apr-11 9:18
David198719-Apr-11 9:18 
GeneralRe: Operator overloading, when to Pin
jschell20-Apr-11 7:50
jschell20-Apr-11 7:50 
GeneralRe: Operator overloading, when to Pin
David198720-Apr-11 7:53
David198720-Apr-11 7:53 
GeneralRe: Operator overloading, when to Pin
Niklas L13-Apr-11 21:11
Niklas L13-Apr-11 21:11 
GeneralRe: Operator overloading, when to Pin
jschell14-Apr-11 9:30
jschell14-Apr-11 9:30 
AnswerRe: Operator overloading, when to Pin
jschell13-Apr-11 8:58
jschell13-Apr-11 8:58 
GeneralRe: Operator overloading, when to Pin
Niklas L13-Apr-11 9:51
Niklas L13-Apr-11 9:51 
QuestionHow to use Uml. Pin
Anubhava Dimri12-Apr-11 22:19
Anubhava Dimri12-Apr-11 22:19 
AnswerRe: How to use Uml. Pin
Pete O'Hanlon12-Apr-11 22:55
mvePete O'Hanlon12-Apr-11 22:55 
QuestionRe: How to use Uml. [modified] PinPopular
#realJSOP13-Apr-11 2:19
professional#realJSOP13-Apr-11 2:19 
GeneralRe: How to use Uml. Pin
Anubhava Dimri13-Apr-11 2:22
Anubhava Dimri13-Apr-11 2:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.