eliminate junk from std.string?

Jonathan M Davis jmdavisProg at gmx.com
Tue Jan 11 16:17:48 PST 2011


On Tuesday, January 11, 2011 16:07:11 Daniel Gibson wrote:
> Am 12.01.2011 00:59, schrieb Jonathan M Davis:
> > On Tuesday, January 11, 2011 15:29:54 Ary Borenszweig wrote:
> >> So what's a good use for aliases?
> > 
> > 2. Deprecating a function name. For instance, let's say that we rename
> > splitl to splitL or SplitLeft in std.string. Having a deprecated alias
> > to splitl would avoid immediately breaking code.
> 
> Isn't this exactly what Ary had in mind? :-)

No, or at least that's not the impression that I got. I understood that he meant 
to have to aliases around permanently. It's just confusing and adds clutter to 
do things like have both splitl and splitLeft (or splitL or whotever splitl got 
renamed to) around in the long run. _That_ is what Andrei and Walter is 
objecting to.

Renaming a function and having a deprecated alias to the old name for a few 
releases eases the transition would definitely be good practice. aliasing a 
function just to have another name for the same thing wouldn't be good practice. 
There has to be a real benefit to having the second name. Providing a smooth 
deprecation route would be a case where there's a real benefit.

- Jonathan M Davis


More information about the Digitalmars-d mailing list