alias two froms

Mike via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 11 16:15:58 PDT 2014


On Thursday, 11 September 2014 at 20:06:17 UTC, Peter Alexander 
wrote:
>
> The problem is that the new syntax is only a few versions old, 
> so deprecating the old syntax means breaking all D code that's 
> more than a year old.
>
> If D had no existing customers then yeah, we'd remove it, but I 
> think it's too early to start deprecation.

If the desire is to deprecate something in the language, it is 
best to start early to prevent the problem from getting worse.

I believe this could be done gradually with little, or no 
disruption.

1. Create a dfix utility to automate updating the alias syntax,
2. Update documentation to fix all examples using the old syntax
3. Update documentation stating that while both syntaxes are 
allowed the latter is preferred
4. Using the dfix utility, update phobos, druntime, and 
potentially other projects in the D ecosystem
5. Give users a few versions to let it sink in
6. Mark old syntax as deprecated so users get a warning
7. Give users a few versions to adjust
8. Finally deprecate old syntax

This recipe could potentially be used to fix many annoyances in 
the language besides the one that started this thread.  But it 
first requires someone (like me) to first create the dfix 
utility.  The existence of such a tool could potentially change 
D's culture as well.  Automating the upgrade of the alias syntax 
would set an important precedent.

Mike


More information about the Digitalmars-d mailing list