Arbitrary abbreviations in phobos considered ridiculous

Nick Sabalausky a at a.a
Sat Mar 10 02:31:31 PST 2012


"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
news:mailman.399.1331365602.4860.digitalmars-d at puremagic.com...
> On Saturday, March 10, 2012 02:21:56 Nick Sabalausky wrote:
>> "Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message
>> > I'd say that there's a higher chance of the aliases being added than of
>> > dur
>> > being changed to duration. Changing dur will _definitely_ break code 
>> > and
>> > make
>> > using it worse for exactly the same reason that it's dur in the first
>> > place -
>> > it's too long when combined with the required units string. The aliases
>> > might
>> > break code, but it's probably only in cases where someone already has 
>> > free
>> > functions with those names, and it's more likely that they'll have
>> > variables
>> > with those names, which are less likely to conflict.
>> >
>> > So, while I don't really like the idea of adding the aliases, they 
>> > _might_
>> > be
>> > added, because they probably won't break anything, and they enable 
>> > UFCS.
>> > But
>> > there's not a good enough reason to change dur to duration at this 
>> > point.
>>
>> They eliminate the *entire* reason for it ever even being "dur" in the 
>> first
>> place.
>
> No, they don't. You have to keep dur if you want to enable generic code.

Sorry, I meant "...the reason for it being named 'dur' instead of 
'duration'."

>...and honestly, I think that it's _worse_ for the very reasons
> that I chose dur in the first place. dur!"hours" is pretty much just as 
> clear
> as duration!"hours", and it's shorter.
>

Well, I gotta say, I'm with Adam on this one: I think "duration" is much 
more clear, much easier to learn, and much easier to remember than "dur". 
Granted, I'm all for abbreviations when they're common enough, such as 
"curr" or "ident", but "dur" is just waaaay out there (And do we really need 
to invite "D: The 'Durrr' Language" heckling?).

That leaves "shorter" the only remaining reason, which becomes insignificant 
with the aliases, since the full "dur/duration" would be only rarely needed 
and the aliases are much shorter than even "dur".




More information about the Digitalmars-d mailing list