[phobos] datetime review

Brad Roberts braddr at puremagic.com
Sun Oct 10 22:38:36 PDT 2010


I haven't been paying enough attention to this thread, nor have I invested the
time to review the code, but I'd like to give you guys something to chew on.
Here's one of the interview questions I use from time to time:

Design a routine to return:
  -1 if less than one month apart
   0 if exactly one month apart
   1 if more than one month apart

The purpose of asking this is to get the candidate to realize that not all
questions have technical answers or are as simple as they seem at first glance.

There's a class of functionality that seems like it make sense to include in low
level libraries, at least at first, but in the end, is really the sort of thing
where there isn't a clearly right answer.  Date math contains a lot of them.  I
strongly urge caution when going beyond the simple, always right, primitives of
dates and times.

Later,
Brad



More information about the phobos mailing list