Let's talk about deprecations

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 3 06:14:02 PDT 2017


On Monday, July 03, 2017 13:04:46 bachmeier via Digitalmars-d wrote:
> On Monday, 3 July 2017 at 11:30:14 UTC, Jonathan M Davis wrote:
> > Ultimately, the way that folks find out about needing to change
> > their code is compiling it and seeing the deprecation messages
> > - or getting compilation errors if they wait too long, but
> > that's a _lot_ more of a pain to deal with than the deprecation
> > messages, so we really don't want to rush the removal.
>
> Something that has worked well for me in other languages (in the
> few cases I've encountered it) has been renaming deprecated
> functions rather than removing them. So rather than foo, the
> function becomes foo_legacy. If foo disappears, the fix is simple
> - change the name to foo_legacy. I try to do that myself, because
> it's not unusual to run across code I haven't used in a few
> years, or code I gave to someone else a few years ago, and you
> don't even remember what the function does, much less how to fix
> it.

Anyone who wants to continue to use a deprecated function is free to copy it
into their own code and continue to use it under whatever name they wish,
but keeping something in Phobos means maintaining it, and if we're trying to
get rid of it, maintaining something permanently under a different name
simply doesn't make sense.

The unDead project exists to make it easier for folks to continue to use
some of the major stuff that was deprecated and removed (or at least ease
the transition when fixing old code that hasn't been updated in years), but
even that has already caused us some maintenance problems, because it does
depend on Phobos on some level and occasionally breaks.

So, in general, I think that it's a big mistake to keep deprecated stuff
along on a permanent or semi-permanent basis. Keeping it around for about
two years like we do now is already quite a long time in that regard. As
long as the symbol doesn't require any maintenance, then it's not a big
deal, but too often, _some_ maintenance does end up being required.

- Jonathan M Davis



More information about the Digitalmars-d mailing list