At Thu, 14 May 2020 09:36:57 +1000 (EST), Dave Horsfall <dave@horsfall.org> wrote:
Subject: Re: [TUHS] v7 K&R C
>
> On Tue, 12 May 2020, Paul Winalski wrote:
>
> > o operator overloading
>
> [...]
>
> I never could figure out why Stroustrup implemented that "feature";
> let's see, this operator usually means this, except when you use it in
> that situation in which case it means something else. Now, try
> debugging that.
Well in the true OO world the ability to "overload" a message (aka what
is sometimes effectively an operator) allows a wise designer to apply
the traditional meaning of that message (operator) to a new kind of
object. Attempts to change the meaning of a message (operator) when
applied to already well known objects is forbidden by good taste and
sane reviewers.
C++ being a bit of a dog's breakfast seems to have given some people the
idea that they can get away with abusing operator overloading for what
can only amount to obfuscation.
--
Greg A. Woods <gwoods@acm.org>
Kelowna, BC +1 250 762-7675 RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Avoncote Farms <woods@avoncote.ca>