Arbitrary abbreviations in phobos considered ridiculous

Brad Anderson eco at gnuk.net
Fri Mar 9 09:01:19 PST 2012


On Fri, Mar 9, 2012 at 1:46 AM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Friday, March 09, 2012 09:33:20 deadalnix wrote:
> > Le 07/03/2012 02:00, F i L a écrit :
> > > I personally find it much easier to remember and use longer, more
> > > sentance-like method names. However, Jonathan and others obviously feel
> > > more comfortable writing with a high level of abbreviation, which they
> > > justify rather well. Still, if D's goal is to gain popularity, I think
> > > it should take notices of other rising languages like C#.
> > >
> > > The problem with making any change to Phobos is backwards
> compatibility.
> >
> > We just need a politic for the change. IE: make the old name a warning,
> > then deprecated, then remove it. Spread the process to a year or so.
>
> We're not changing symbol names without a good reason. Yes, there's a
> deprecation process that allows us to change them if we need to, but it's
> still disruptive.
>
> - Jonathan M Davis
>

The "secs" and "seconds" inconsistency is something I've seen people in IRC
hit and complain about on several occasions.  The dur!"seconds"(1) syntax
I've seen complained about or confusion over on both IRC and on reddit by
active and potential users.  While I don't feel particularly strong about
these issues I feel I should point out that actual users are hitting them
and the issues bug them enough that they feel the need to
complain publicly.  Changes must be made with care but the former issue on
inconsistency, I would argue, is a bigger issue than, say, the current
symbol deprecation/replace of toISOExtendedString (though I don't know the
history of the decision to make the change).

There shouldn't be two ways of expressing the exact same thing so the
"secs"/"seconds" should be a substitute and deprecate process rather than
just a simple alias if it were made. It looks like it's been rejected
already, though, which is unfortunate.  phobos is still a young library (or
at least parts of it, like datetime, are) and so these types of wart
removal could be made with limited disruption to current users.

The dur aliases would be welcome because they increase readability,
intuitive design, and brevity.  I know I just said their shouldn't be two
ways of doing the same thing but I don't feel this is the case here.  It's
a shortcut to doing exactly one thing and, as I said before, I wouldn't
want to lose the option of genericity. I just want to make specification of
it optional since I would use seconds(5) a great deal more often than
dur!base(5) (though I would use the latter fairly frequently in my line of
work).

Anyway, I just felt I'd share my opinion and what I've witnessed of other
users so it's at least it's heard and taken into consideration. The
decision is ultimately yours and Walter's.

Regards,
Brad Anderson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120309/146445aa/attachment-0001.html>


More information about the Digitalmars-d mailing list