On Thu, Aug 13, 2009 at 1:51 PM, Ben Schulz <[email protected]> wrote:

>
> On 13 Aug., 13:43, Casper Bang <[email protected]> wrote:
> > With all due respect, operator overloading in Fan is an entirely
> > different, much less scary beast than the infamous C++ implementation
> > which everyone seems to have in mind. I'm not much for guns, but to
> > continue gun metaphor: Python and C# both demonstrates that this is
> > not necessarily an exploding Uzi. But if your premise is that
> > programmers will do bad things when given the slightest chance, then
> > remember that you don't actually need a gun to kill somebody - it just
> > gets the job done easier and faster.
>
> Oh, I'm for operator overloading, but I don't think the arguments for
> it can be reduced to "So operator overloading is bad because people
> have HR problems?" and "Don't blame the gun, blame the shooter."



Basically, my point comes down to:

If operator overloading is bad because people might get it wrong, then
method overloading is bad for the exact same reason.

def equals(o : AnyRef) : Boolean = Math.random() > 0.5d

So basically we're down to: If you're to allow people to overload methods,
please use some kind of contract enforcing mechanism (Unit tests come to
mind).



>
>
> With kind regards
> Ben
> >
>


-- 
Viktor Klang

Rogue Scala-head

Blog: klangism.blogspot.com
Twttr: viktorklang

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to