Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: looking at generic



Rolf Howarth wrote:

Since Java IS overloading operators (yes you can ADD strings), why are you
against operator overloading ?

There's a huge difference between built-in operator overloading (which every language since Fortran has had) and user-defined operator overloading. The latter leads to confusion that the former doesn't because


1. Everyone agrees on what the built-in operators do with the built-in types.
2. It's immediately obvious when reading code what the built-in operators do.


This is not the case with user-defined operator overloading. Outside of a few very mathematical cases like complex numbers, you rapidly run into things like someone adding two database records together, and then you begin wondering just what the semantics of that operation are. Method names normally provide more explicit information about the nature of the operation they're performing.

--
Elliotte Rusty Harold  email@hidden
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: looking at generic (From: Rolf Howarth <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.