Against deprecating aliases

Jonathan M Davis jmdavisProg at gmx.com
Thu Sep 29 20:24:06 PDT 2011


On Thursday, September 29, 2011 01:02:37 Jonathan M Davis wrote:
> On Thursday, September 29, 2011 00:47:46 Andrei Alexandrescu wrote:
> > On 9/28/11 12:56 PM, Jonathan M Davis wrote:
> > > On Wednesday, September 28, 2011 21:43:13 Andrej Mitrovic wrote:
> > >> TLDR: Don't make Phobos upgrades annoying.
> > > 
> > > Having toUTF and toUTFz is a marked improvement in many cases -
> > > especially for generic code. They're being added regardless of what
> > > the
> > > deal with toUTF16z is.
> > > 
> > > The reason that toUTF16z is being removed is essentially because
> > > Andrei
> > > is very much opposed to having functions with specific types in
> > > their
> > > names and thinks that they should all be generic. Personally, I'm
> > > not
> > > opposed to keeping toUTF16z as an alias or wrapper to toUTFz. It's
> > > Andrei that seems to feel stongly about it. So, if enough people
> > > really
> > > want to keep toUTF16z, then I think that that can happen.
> > 
> > There is such a notion as too much of a good thing. That applies to file
> > size, rote repetition in unittests, naming conventions, and more.
> > 
> > Suggestions I give should not be construed as immutable law that must be
> > obeyed without applying good judgment.
> 
> True. But when we discussed it, you favored getting rid of toUTF16z, and you
> seemed to be very much in favor of doing so. So, we ended up going with
> deprecation. If you want to change your mind and argue that toUTF16z should
> be kept, I'm fine with that. Personally, I'm divided on the matter. I
> wouldn't add toUTF16z if it didn't already exist, but since it already
> exists and toUTFz is a bit cumbersome in comparison, I think that there's a
> solid argument for keeping it.
> 
> But because I didn't feel particularly strongly either way, and you
> definitely seemed to be in favor of deprecation, we went with your decision
> on the matter before. We can certainly change that decision now. The
> function has been marked as scheduled for deprecated, but not actually
> deprecated yet - lot alone removed - so it's not exactly a hard to
> reinstate it.

Okay. Since I'm rather ambivalent on whether toUTF16z should be kept around or 
not (there are good arguments on both sides) and the main reason that it was 
scheduled for deprecation in the first place was that you seemed to definitely 
favor getting rid of it, as long as you don't have a problem with it staying, 
I'm going to reinstate toUTF16z such that it's no longer scheduled for 
deprecation, since it's clearly something that the Windows folks want to stick 
around.

- Jonathan M Davis


More information about the Digitalmars-d mailing list