Click here to Skip to main content
15,885,032 members
Home / Discussions / C#
   

C#

 
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 
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 
David1987 wrote:
All programs I've actually worked on were written either by just myself or me
and a bunch of friends all of whom are not noobs who use strings for everything.


You were using that as analogy for abuse which was comparable to the abuse in operator overloading.

Your very statement here however suggests that you yourself do not consider it an apt analogy.

David1987 wrote:
Yes, it's C++.
Argument dismissed.
C++ has operator overloading abuse
built-in with their << on streams.
And besides, we were talking about
C#.



First I can provide a quote from Stroustrup that says that he specifically thinks that the operator overloading in streams is an excellent use.

Second C++ has been around much longer than C# and has a larger base of code. Thus one can judge the impact better.

Third C# does not limit operator overloading in such a way to make it incompatible with the problems that one might experience from abusing the idiom. Just as with C++.

Fourth I am not now nor have I ever been discussing this in terms of only C#. I am referring the realm of possibilities for operator overloading of which the two languages, C# and C++, have sufficient user bases to evaluate usage. There are other languages which support operator overloading as well. It is possible some of the more esoteric ones might be a better fit for the idiom due to the nature of the language. But neither C# nor C++ is.

David1987 wrote:
That doesn't matter (though there are definitely a lot in scientific code - if
we ignore the Boring Code that becomes a lot more significant). Vectors aren't
the only thing that should behave like a mathematical type instead of
objects.



Yes it does matter.

C#, Java and C++ are general purpose languages. They were designed and have evolved to support a wide range of problems. They are NOT designed to be ideal tools for specific problem domains.

There are languages specifically designed to support a narrow range of problems. Such languages would be designed to support idioms specific to the nature of the domain they are targeted at. And there are languages specifically targeted to support scientific and mathematical problems which not only support the features that you are touting but do so at the native level.

It is a matter of using the right tool for the right job.


David1987 wrote:
Because a vector shouldn't be modeled as an object. A vector is a value, so
that's exactly what it should be modeled as.


And when I want to use nails that use a 22 caliber shot then I select a nail gun that can deliver that appropriately rather than attempting to use a hammer.

And in the same way if your primary purpose is vector arithematic then I suggest you select a tool appropriate for that. As an example Mathmatica.

http://reference.wolfram.com/mathematica/tutorial/VectorsAndMatrices.html[^]
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
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 

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.