[Python-Dev] dateutil

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Mar 15 18:17:47 EST 2004


Kevin Jacobs <jacobs at theopalgroup.com>:

> After using such a system in a large system with non-trivial date
> manipulations, I think you'd change your mind about that approach --
> it can be excessively verbose.

Maybe, but I'm skeptical of that. The less trivial the operations
are, the more I'm likely to want to see spelled out clearly what
is being done and what order it's being done in. 

I'm usually quite willing to accept some verbosity if it contributes
clarity.  Whenever I try to come up with some clever coding scheme to
reduce verboseness, I usually end up regretting it, because clarity
suffers and when I came back to the code later I have a hard time
figuring out what's going on. Usually I end up rewriting it verbosely
all over again so that I understand it.

Someday I may learn my lesson and just leave it verbose in the
first place...

> However, in my datetime classes, I also have a very complete set of
> calls like: startOfMonth, endOfMonth, startOfYear, endOfYear,
> lastWeekday, nextWeekday, etc...

That's good. Having two completely different ways of expressing the
same thing seems like Too Many Ways To Do It, though, especially if
this stuff is to be included in the standard library.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list