comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Top 10 Worst C# Features
Date: Wed, 14 Oct 2015 01:00:55 -0700 (PDT)
Date: 2015-10-14T01:00:55-07:00	[thread overview]
Message-ID: <5cb5c989-4d12-41d8-88df-ab45988ba8a1@googlegroups.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1510011551120.1702@Lydia.insomnia247.nl>


> One of the bugs which I detected in Crap-Poo-Poo code which I referred
> to in the paper referred to below involved two functions like these,
> but they accidentally did not return values compatible with each
> other. I explained this to Crap-Poo-Poo advocates involved, but they
> lacked sufficient intelligence to comprehend a reason as to code
> cloning producing a bug.

Apparently you have talked to wrong advocates.
For the sake of discussion I will play that role in this post.

Yes, we understand that it is possible to have incompatible implementations of operator== and operator!= in C++ (assuming that this is the language you are referring to), but we are willing to take this risk (and address it by other means) as it allows us to implement these operators more efficiently.
One possible example where this could be possible is when the encapsulated data has a digital signature or some other short digest available with the property that when two digests are different then the objects are surely different (and this can be determined very quickly), whereas when the digests are equal then more work is needed to determine whether the objects are equal, too. In this case, our operator!= can be much faster than operator== and we are willing to benefit from the optimization opportunity here. This could not be possible if one is automatically derived from the other.

> I also advised that Ada does not do
> this.

Yes, we know that Ada prevents some optimization strategies. This is not the only one.

> They persisted with Crap Poo Poo.

Yes, we prefer to get better performance at the expense of higher verification effort.


If you are willing to address the above, please use the actual name of the programming language that you are referring to.

-- 
Maciej Sobczak * http://www.inspirel.com


  reply	other threads:[~2015-10-14  8:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 10:59 Top 10 Worst C# Features Stefan.Lucks
2015-09-02 17:37 ` Álex R. Mosteo
2015-09-02 19:39 ` Randy Brukardt
2015-09-03  8:14   ` Georg Bauhaus
2015-09-03  9:26     ` Dmitry A. Kazakov
2015-09-03 11:39       ` G.B.
2015-09-03 12:00         ` G.B.
2015-09-03 13:59           ` Dmitry A. Kazakov
2015-09-03 19:12           ` Randy Brukardt
2015-09-04  7:33             ` Georg Bauhaus
2015-09-04 21:34               ` Randy Brukardt
2015-09-05  6:31                 ` Dmitry A. Kazakov
2015-09-05  6:44                 ` Georg Bauhaus
2015-09-05  7:07                   ` Dmitry A. Kazakov
2015-09-05  6:45                 ` Niklas Holsti
2015-09-05  7:21                   ` Dmitry A. Kazakov
2015-09-05 12:07                   ` Peter Chapin
2015-09-06 10:45                   ` Georg Bauhaus
2015-10-13 19:57                   ` Eryndlia Mavourneen
2015-09-05  7:16                 ` Shark8
2015-09-03 13:47         ` Dmitry A. Kazakov
2015-09-03  8:51 ` gautier_niouzes
2015-10-01 14:03 ` Paul Colin de Gloucester
2015-10-14  8:00   ` Maciej Sobczak [this message]
2015-10-14 14:26     ` Ben Bacarisse
2015-10-14 16:50       ` Paul Rubin
2015-10-14 18:17         ` Stefan.Lucks
2015-10-14 19:54           ` Ben Bacarisse
2015-10-15 12:24       ` Maciej Sobczak
2015-10-15 13:59         ` Ben Bacarisse
2015-11-06 14:50     ` Nicholas Collin Paul de Gloucester
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox