Phobos - breaking existing code

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 29 13:56:19 PST 2014


On Sat, Nov 29, 2014 at 08:32:37PM +0000, Kapps via Digitalmars-d wrote:
> On Friday, 28 November 2014 at 23:33:54 UTC, Walter Bright wrote:
> >Just for fun, I've decided to try and get MicroEmacs in D added to
> >the dub registry. The last time it compiled was 2 years ago.
> >
> >I wound up with at least a dozen references to Phobos names that have
> >disappeared. No corrective action was indicated, just "undefined
> >symbol".  I have to go refigure out what the code was trying to do,
> >and go poking through the Phobos documentation to see what will work
> >today.
> >
> >I know there's been a lot of "break my code" advocacy lately, but
> >this code was only 2 years old.
> >
> >I fully understand how unfriendly this is to users and how
> >discouraging it can be to have their recently working code shattered
> >and scattered. We need to do a lot better.
> 
> Why are deprecated aliases even removed in the first place? Is there
> any harm in keeping them for 5+ years (undocumented of course)? There
> isn't any increased complexity for the user, you can completely ignore
> them during development, and if needed they could just go to the
> bottom of the scope/file hidden away from the rest of the code.

Yeah we should keep deprecated aliases around for much longer than we
currently do.

Having said that, though, there *are* some cases where we can't keep an
old symbol around, e.g., it causes conflicts with newer overloads. But
that shouldn't be a problem in this case, as it'd be clear that that
particular function now requires different arguments, whereas Walter was
complaining about symbols that vanished into thin air without a clue as
to where they went.

There's also the issue of symbols that got moved to a different module.
Sometimes leaving an alias behind is not workable, because it will cause
conflicts when user code imports both modules. Unless, of course, we
change overload rules to allow such apparent conflicts when they
actually ultimately resolve to the same symbol in the end.


T

-- 
For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.


More information about the Digitalmars-d mailing list