Creeping Bloat in Phobos

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 29 05:47:08 PDT 2014


On Sunday, 28 September 2014 at 23:21:15 UTC, Walter Bright wrote:
> On 9/28/2014 1:39 PM, H. S. Teoh via Digitalmars-d wrote:
>>> It can work just fine, and I wrote it. The problem is 
>>> convincing
>>> someone to pull it :-( as the PR was closed and reopened with
>>> autodecoding put back in.
>>
>> The problem with pulling such PRs is that they introduce a 
>> dichotomy
>> into Phobos. Some functions autodecode, some don't, and from a 
>> user's
>> POV, it's completely arbitrary and random. Which leads to bugs 
>> because
>> people can't possibly remember exactly which functions 
>> autodecode and
>> which don't.
>
> That's ALREADY the case, as I explained to bearophile.
>
> The solution is not to have the ranges autodecode, but to have 
> the ALGORITHMS decide to autodecode (if they need it) or not 
> (if they don't).

No it isn't, despite you pretending otherwise. Right now there is 
a simple rule - Phobos does auto-decoding everywhere and any 
failure to do so is considered a bug. Sometimes it is possible to 
bypass decoding for speed-up while preserving semantical 
correctness but it is always implementation detail, from the 
point of view of the API it can't be noticed (for valid unicode 
string at least).

Your proposal would have been a precedent to adding _intetional_ 
exception. It is unacceptable.


More information about the Digitalmars-d mailing list