On Wednesday, October 30, 2013 07:56:04 Andrei Alexandrescu wrote: > On 10/30/13 2:14 AM, monarch_dodra wrote: > > On Tuesday, 29 October 2013 at 23:39:13 UTC, Andrei Alexandrescu wrote: > >> I'm okay with either choice, just not both. There's precedent in other > >> languages for stripLeft and stripRight, but stripFront/Back are closer > >> to D's terminology. I have a very mild preference for the latter. > > > > Funny you should say that, because my first reflex was to google search > > "stripLeft" to see if there was a precedent for it, and found nothing > > outside of dlang. > > > > Who else uses "stripLeft" in their standard library? > > > > I vote to change the names to stripFront/stripBack, and make deprecated > > aliases of stripLeft/stripRight in std.string. > > I could have sworn googling for them would return a bunch of languages > and libraries. I could only find on Haskell library. But then I could > only find one library using stringFront/Back. > > Since we've already had stripLeft/Back for strings, I vote to stop this > changing names nonsense. Either pair is good, and we've voted for one > already.
They were originally stripl and stripr, so googling may find those more easily. But that didn't follow our naming conventions, so we changed it when we tried to make std.string consistent with our naming scheme. And stripLeft and stripRight are what stripl and stripr stood for, so that's how they got those names. stripFront and stripBack would arguably be better names for ranges in general, but given that we already have stripLeft and stripRight, I agree that we should just leave it as-is rather than having to deal with renaming std.string.stripLeft and std.string.stripRight yet again. stripLeft and stripRight might not be quite as nice names for range-based stuff, but they work. We can argue names all day, and I don't think that there's enough gain in this case to be worth the change. If the original names had followed our naming conventions properly, they likely never would have been renamed in the first place. That's the primary reason that we've renamed stuff, and that's not the case here. - Jonathan M Davis
