On 2012-03-06 17:38, Adam D. Ruppe wrote:
One of the stumbling blocks on using std.datetime is how many bizarre abbreviations it has.auto time = Clock.currentTime(); // bzzt, wrong if(time - something > duration!"hours"(4)) // bzzt, wrong writeln(time.toISOExtendedString()); // bzzt, wrong, but this used to work! Why aren't we using real words here? Real words are easier to remember and easier to type. This is almost as bad as "creat" and "umount". It's like these names are deliberately designed to fail your first guess. Our minds are pretty good at remembering words and sentences; it is an existing database in there that follow established patterns. Arbitrary abbreviations only work through special-cased brute force rote memorization. And the dmd spellchecker doesn't always help: Error: template instance duration!("hours") template 'duration' is not defined, did you mean Duration? Nope, apparently, I meant "dur". Ridiculous. std.datetime isn't the only one that does this, of course. rndGen() in the middle of sane names like "unpredictableSeed" and "randomShuffle". There's more, too. Some abbreviations are justified by precedent. rmdir() has been around for a long time, so we know what it is. Stringz is similarly classic. "printf" is one of the earliest words many of us saw as programmers. But "dur"? "curr"? What the hell? Can we please stop this?
Yes, please, I completely agree. -- /Jacob Carlborg
