-
-
Notifications
You must be signed in to change notification settings - Fork 422
Replace dur!"minutes"(3) with minutes(3), etc. Maintain a duration!"minutes"(3) for the sake of generic code. #174
Conversation
|
The following pull requests go together with this: |
|
I am completely against renaming I'm also inclined to reject this for adding unnecessary aliases, but they do make it possible to do stuff like |
|
@Abscissa |
|
@dawgfoto
I see no point in not replacing them. It's already done, ready to be pulled. It doesn't hurt anything and it makes the code less verbose and much more readable. And if usage of the aliases is just going to be discouraged like that, then why even have them? In any case, I've created a new alternative pull request: #188 |
|
So I assume I should just close this, at least for now. |
|
If it were purely my decision, I would not make any changes like this, but there are a number of people who really want them, and druntime and Phobos aren't my projects, so other people's opinions obviously matter quite a bit. So, I'm a bit divided on it, and that's why I haven't close this previously. I'm fine if you want to close it though. |
|
I think #188 supersedes this. |
|
@alexrp It's the same thing done differently. |
|
@alexrp is right. |
Replace
dur!"minutes"(3)withminutes(3), etc. Maintains aduration!"minutes"(3)for the sake of generic code. Theduris kept as a "to be deprecated" transition path leading up to the preferred alternative ofminutes(3)for the majority of code, anddurationfor the rare cases genericness is needed.These changes provide decreased verbosity without the need for the contrived and controversial
durabbreviation, and also without removing the ability to be generic.I would STRONGLY assert that this is NOT a case of "pointless aliasing" in the std lib: The idea here is that
minutes()/hours()/etc.ARE the new replacement fordur. Thedurationis ADDED functionality on top ofminutes()/hours()/etc.So why not just usedur/durationinstead ofminutes()/hours()/etc.? Because in the vast majority of use-cases,dur/durationare needlessly verbose to a degree that's unreasonable for simply referring to X units of Y time.This is based on discussion, which had overall strong support for the change, in these NG subthreads:
http://forum.dlang.org/post/jj6gjm$2m6a$1@digitalmars.com
http://forum.dlang.org/post/mailman.115.1331078432.4860.digitalmars-d@puremagic.com
http://forum.dlang.org/post/jj6hnv$2o9s$1@digitalmars.com