Click here to Skip to main content
15,891,513 members
Home / Discussions / C#
   

C#

 
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 
Niklas Lindquist wrote:
Coming from C++, I overloaded operator== et al, to compare the actual values


I am taking that to mean that you are overloading others besides equality.

Coming from C++ I almost never used operator overloading. At two C++ shops it was specifically forbidden to use it.

Excluding the comments about equality there can be specific circumstances where operators (all of them) might be appropriate to use.

Numeric representation are example of this. Thus Length might be a suitable candidate.

Angle on the other hand is less clear. But possible.

But hypothetically does a "geometry primitives" include a circle, square and rectangle?

If so please explain, objectively, how one implements less than for a square. And how one represents it for a square and rectangle. And a square and circle.

And once you have that if someone else can come up with a different interpretation then - don't use operator overloading because the operation is not in fact clear and well defined.

As an example of this what does less than mean for an Angle? Seems obvious that 60 degrees is less than 90 degrees. However is 60 degrees less than 300 degrees? And if you think that is obvious then draw a 60 degree angle in a circle and explain what the 'angle' measures on both sides of the line.
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
mve#realJSOP13-Apr-11 2:19 
GeneralRe: How to use Uml. Pin
Anubhava Dimri13-Apr-11 2:22
Anubhava Dimri13-Apr-11 2:22 
GeneralRe: How to use Uml. Pin
Ravi Sant14-Apr-11 0:57
Ravi Sant14-Apr-11 0:57 
GeneralRe: How to use Uml. Pin
wizardzz13-Apr-11 11:20
wizardzz13-Apr-11 11:20 
GeneralRe: How to use Uml. Pin
#realJSOP13-Apr-11 11:50
mve#realJSOP13-Apr-11 11:50 
QuestionRe: How to use Uml. Pin
Pete O'Hanlon13-Apr-11 22:02
mvePete O'Hanlon13-Apr-11 22:02 
QuestionRe: How to use Uml. Pin
#realJSOP14-Apr-11 2:04
mve#realJSOP14-Apr-11 2:04 
AnswerRe: How to use Uml. Pin
#realJSOP14-Apr-11 2:06
mve#realJSOP14-Apr-11 2:06 
Questiondifference between a keyboard and a barcode reader Pin
tek 200912-Apr-11 22:15
tek 200912-Apr-11 22:15 
JokeRe: difference between a keyboard and a barcode reader Pin
wizardzz13-Apr-11 11:19
wizardzz13-Apr-11 11:19 
AnswerRe: difference between a keyboard and a barcode reader Pin
Ravi Sant14-Apr-11 1:02
Ravi Sant14-Apr-11 1:02 
AnswerRe: difference between a keyboard and a barcode reader Pin
Bernhard Hiller14-Apr-11 23:51
Bernhard Hiller14-Apr-11 23:51 
Generaltime limited trial version ,Setup maker (installer) (With checking .Net framework and sql server installed or not... Pin
raviraj.plural12-Apr-11 21:09
raviraj.plural12-Apr-11 21:09 
GeneralRe: time limited trial version ,Setup maker (installer) (With checking .Net framework and sql server installed or not... Pin
Anubhava Dimri12-Apr-11 22:26
Anubhava Dimri12-Apr-11 22:26 

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.