[TUHS] v7 K&R C

Greg A. Woods woods at robohack.ca
Thu May 14 14:21:34 AEST 2020


At Thu, 14 May 2020 09:36:57 +1000 (EST), Dave Horsfall <dave at 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 at acm.org>

Kelowna, BC     +1 250 762-7675           RoboHack <woods at robohack.ca>
Planix, Inc. <woods at planix.com>     Avoncote Farms <woods at avoncote.ca>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP Digital Signature
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200513/10ca3fe5/attachment.sig>


More information about the TUHS mailing list