On Friday, March 09, 2012 10:28:12 deadalnix wrote: > Le 09/03/2012 10:07, Jonathan M Davis a écrit : > > On Friday, March 09, 2012 09:55:50 deadalnix wrote: > >> Le 09/03/2012 05:42, H. S. Teoh a écrit : > >>> On Thu, Mar 08, 2012 at 07:07:43PM -0500, Jonathan M Davis wrote: > >>>> On Thursday, March 08, 2012 12:10:07 H. S. Teoh wrote: > >>>>> IMO, making all abbreviations in Phobos consistent would be a big > >>>>> step forward. > >>>> > >>>> You know, people keep saying that the abbreviations are inconsistent, > >>>> but I don't buy that. _What_ abbreviations are inconsistent? > >>> > >>> [...] > >>> > >>> My comment was referring specifically to the pull request that adds > >>> "secs" as an alternative for "seconds". From what Walter said, he seems > >>> to be against any renaming changes, so any existing inconsistencies that > >>> we might find seems likely to be rejected as well. > >> > >> Why it isn't possible to support both ? And miliseconds as well a usecs > >> ? This make sense, as long as they are both common. > > > > Because it creates needless aliases. Now you have to remember _both_ of > > them, because they're both going to be used in code. And people reading > > code will wonder what the difference is. It just adds more confusion to > > the library and reduces its cohesiveness and consistency. It works far > > better to just have the one symbol. Isn't that one of the major > > complaints about PHP? That it has a ton of different ways to do the same > > thing? > > > > Walter and Andrei are very much against having aliases in the library just > > to create different names for the same stuff. And adding more options for > > the time units argument to the templates that use them is basically the > > same thing. So, we're not going to add such aliases. It's not like it's > > all that hard to learn the library, and none of the names are horribly > > wrong. They just don't happen to be the names that you prefer. You have > > to learn the names of the symbols of _any_ library that you use. This is > > no different. > > > > - Jonathan M Davis > > This is not alias. This is about accepting template parameters. The > actual isn't very consistent anyway (seconds, but usecs ?).
It amounts to the same thing, and core.time and std.datetime are as consistent as they're going to get. seconds are _always_ seconds, and _no_ units greater than seconds are ever abbreviated. Only the sub-second units are abbreviated. And they're abbreviated only because they would have been way too long otherwise. And making seconds secs would create even _more_ inconsistencies. Just read the discusion in the pull request: https://github.com/D-Programming-Language/druntime/pull/173 - Jonathan M Davis