The Case Against Autodecode

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 08:04:07 PDT 2016


On Tuesday, 31 May 2016 at 13:33:14 UTC, Marc Schütz wrote:
> In an ideal world, the programs someone intuitively writes will 
> do the right thing, and if they can't, they at least refuse to 
> compile. If we agree that it's up to the user whether to 
> iterate over a string by code unit or code points or graphemes, 
> and that we shouldn't arbitrarily choose one of those (except 
> when we know that it's what the user wants), then the same 
> applies to indexing, slicing and counting.

If the user doesn't know how he wants to iterate and you leave 
the decision to the user... erm... it's not going to give correct 
result :)


More information about the Digitalmars-d mailing list