Arbitrary abbreviations in phobos considered ridiculous

Jacob Carlborg doob at me.com
Wed Mar 7 00:00:02 PST 2012


On 2012-03-07 01:01, Ary Manzana wrote:
> On 3/6/12 8:58 PM, Ary Manzana wrote:
>> On 3/6/12 8:43 PM, Jonathan M Davis wrote:
>>> On Tuesday, March 06, 2012 17:38:09 Adam D. Ruppe wrote:
>>>> writeln(time.toISOExtendedString()); // bzzt, wrong, but this
>>>> used to work!
>>>
>>> Yes, and it was quickly changed to toISOExtString, because
>>> toISOExtendedString
>>> is painfully long. toISOExtString is bad enough, but you can't really
>>> make it
>>> any shorter without making the name uninformative.
>>>
>>>> Nope, apparently, I meant "dur". Ridiculous.
>>>
>>> A Duration needs to be constructed with a template, and
>>> duration!"hours"(13),
>>> duration!"seconds"(44), etc. is painfully long when used in
>>> expressions. So,
>>> it was shortened to dur. I don't know of any other abbreviation which
>>> would
>>> make sense.
>>
>> Painfully long?
>>
>> How much time does it take you to type 5 more chars? How much time does
>> it take you to understand "dur" when you read it instead of "duration"?
>
> Also, it becomes long because it has a weird syntax, that either way is
> going to be hard to read. In Ruby (with active support) I can just do:
>
> 44.seconds
>
> Why D doesn't do the same if it has UFCS? (I hope I got the acronym well)

Yeah, time and dates are ridicules easy in Ruby with active support. Say 
I want the date from two weeks ago, I just say that:

a = 2.weeks.ago

Super easy.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list