Arbitrary abbreviations in phobos considered ridiculous

Ary Manzana ary at esperanto.org.ar
Tue Mar 6 15:58:52 PST 2012


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"?

>
> I agree with H.S. Teoh in that abbreviations should be meaniful and consistent
> but that they _should_ be used where applicable. Code becomes painfully long
> otherwise - especially when chaining function calls and the like.

Code becomes painfully long when you write lots of lines, not when you 
write long lines. Specially when you write lots of boilerplate lines.

> Symbol names should be descriptive while still being as short as they can
> reasonably be without losing meaning.
>
> - Jonathan M Davis



More information about the Digitalmars-d mailing list