std.uni.toLowerCase / .toUpperCase

Jeremy Powers via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 23 16:51:57 PDT 2015


On Tue, Jun 23, 2015 at 4:27 PM, Tofu Ninja via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Tuesday, 23 June 2015 at 23:17:54 UTC, Meta wrote:
>
>> On Tuesday, 23 June 2015 at 22:58:32 UTC, Vladimir Panteleev wrote:
>>
>>>
>>> Proposed new name: lowerCased / upperCased
>>>
>>
>> I really hate this naming scheme for functions that take lazy parameters.
>> I still don't see why we don't do the (IMO) simplest and most intuitive
>> thing and name them lazyToLower / lazyToUpper (or toLowerLazy /
>> toUpperLazy). ...
>
>
> Yes please! If I didn't know what they were replacing, I would have no
> idea what withExtension, lowerCased, or upperCased meant at all. They
> hardly seem better than what they are replacing. Just do setExtensionLazy /
> toLowerLazy / toUpperLazy. It is much simpler and clearer.
>

Counter argument:

If the lazy versions are expected to be preferred/used often, then using a
'Lazy' suffix for them is wordy and counterproductive.  You want the
preferred method to be nicer than the alternative, which having extra
'Lazy' on the end isn't.

Lazy suffix smacks of lazy naming to me.


Point the first: There should be a different convention for these different
methods (believe there is no argument here).

Point the second: This convention should apply throughout phobos, trying to
choose on a method-by-method basis gives a crappy library.

Point the third: Pretty/intuitive range-centric names are good.  Names
should reflect that this is a different approach, not just 'toFooRanged'.

TL;DR I like Vladimir's names, don't like toLowerLazy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150623/71fe2e2e/attachment.html>


More information about the Digitalmars-d mailing list