Why not flag away the mistakes of the past?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu Mar 8 17:14:16 UTC 2018


On Thursday, March 08, 2018 16:34:11 Guillaume Piolat via Digitalmars-d 
wrote:
> On Wednesday, 7 March 2018 at 13:24:25 UTC, Jonathan M Davis
>
> wrote:
> > On Wednesday, March 07, 2018 12:53:16 Guillaume Piolat via
> >
> > Digitalmars-d wrote:
> >> On Wednesday, 7 March 2018 at 06:00:30 UTC, Taylor Hillegeist
> >>
> >> wrote:
> >> > That way the breaking change was easily fixable, and the
> >> > mistakes of the past not forever. Is it just the cost of
> >> > maintenance?
> >>
> >> auto-decoding problem was mostly that it couldn't be @nogc
> >> since throwing, but with further releases exception throwing
> >> will get @nogc. So it's getting fixed.
> >
> > I'd actually argue that that's the lesser of the problems with
> > auto-decoding. The big problem is that it's auto-decoding. Code
> > points are almost always the wrong level to be operating at.
> > The programmer needs to be in control of whether the code is
> > operating on code units, code points, or graphemes, and because
> > of auto-decoding, we have to constantly avoid using the range
> > primitives for arrays on strings. Tons of range-based code has
> > to special case for strings in order to work around
> > auto-decoding. We're constantly fighting our own API in order
> > to process strings sanely and efficiently.
>
> I'd agree with you, hate the special casing. However it seems to
> me this has been debated to death already, and that auto-decoding
> was successfully advocated by Alexandrescu and al; surviving the
> controversy years ago.

Most everyone who debated in favor of it early on is very much against it
now (and I'm one of them). Experience and a better understanding of Unicode
has shown it to be a terrible idea. I question that you will find any
significant contributor to Phobos who would choose to have it if we were
starting from scratch, and most of the folks who post in the newsgroup agree
with that. The problem is what to do given that we don't want it and that no
one has come up with a way to remove it without breaking tons of code in the
process or even providing a clean migration path. So, given how difficult it
is to remove at this point, you'll find disagreement about how that should
be handled ranging from deciding that we're just stuck with it to wanting to
remove it regardless of the cost. But there seems to be almost universal
agreement now (certainly among the folks who might make such a decision)
that auto-decoding was a mistake. So, there's agreement that it would
ideally go, but there isn't agreement on what we should actually do given
the situation that we're in.

- Jonathan M Davis



More information about the Digitalmars-d mailing list