× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Besides, operator overloading, especially in the case above, is a very

questionable technique.

Operator overloading is not that questionable. Overloading the =
operator may be though. :) It basically boils down to a question of
whether your class should exhibit value semantics or reference
semantics. After all given:

int x=7;
int y=x;
x = x + 1;

you'd expect x to equal 8, and y to still equal 7, no? Operator
overloading would allow a fix to the silly problem with decimals. I
could simply add two decimals and get the right answer, because while
the BigDecimal is an object, it should exhibit value semantics.

It falls in the category of clever coding, and can lead to absolutely
undebuggable code.

Sure can. But it can also make code more readable. Like everything else,
it's a tool. Used the right way it helps, used the wrong way it hurts.
Of course, since Java doesn't support operator overloading you'd expect
pro-java people to take the position that it's not needed wouldn't you.
:)

-Walden


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.