Power (Re: all those :-)
Chip Salzenberg
chip at ateng.UUCP
Fri Feb 12 04:19:04 AEST 1988
In article <132 at ghostwheel.UUCP> ned at ghostwheel.aca.mcc.com.UUCP (Ned Nowotny) writes:
>In article <744 at PT.CS.CMU.EDU> edw at IUS1.CS.CMU.EDU (Eddie Wyatt) writes:
>>Why not? why not have an extendable language, where the user is free to
>>define his own infix operators?
>
>In some sense, C++ has this (mis-)feature -- operator and function overloading.
>
>Unfortunately, not all programmers seem to agree on what constitutes a good
>use of operator overloading. I have seen code which overloaded "+" and "-"
>to add and remove, respectively, an object from a set of objects.
>
>do_something();
>A + B;
>do_something_else();
>
>That's right. It looks like a useless expression, but its not.
And I have seen code where "read()" writes and "write()" reads. So what?
The programmer should have defined "+=" instead of "+". So fire the
programmer; don't hobble the other programmers by restricting their
power of expression.
>Of course, it can be argued that the misuse of a feature by a programmer is
>no excuse for blaming the feature.
I couldn't agree more. :-|
--
Chip Salzenberg UUCP: "{codas,uunet}!ateng!chip"
A T Engineering My employer's opinions are a trade secret.
"Anything that works is better than anything that doesn't."
More information about the Comp.lang.c
mailing list