need "yy-ddd-hh:mm:ss ==> (time_t) clock" converter

Dave Gillett dgil at pa.reuter.COM
Mon Feb 25 20:26:48 AEST 1991


In <1991Feb18.133937.28469 at fivegl.co.nz> hugh at fivegl.co.nz (Hugh Grierson) writes:

>Maintainability????  How often *do* you have to change the number
>of days in a month?????  (Sept 1752 notwithstanding)

>Readability? A one-line comment...


     Sorry.  If I'm trying to find a defect in the program's date-handling, I
can verify by eye the {31, 28, ... } form.  Even with a comment, it may take
several moments to understand what the {31, 59, ... } form is trying to do --
especially if I didn't write this piece of code (which happens, you know).
     And it will take several minutes to verify that these magic numbers are
in fact calculated correctly, a waste of both the author's and the maintainer's
time and effort.  If your algorithm, for efficiency's sake, really must use
the numbers in this form, then the table should be built by the machine at run
time, and the numbers in the source should be the familiar ones that anyone can
easily verify.
                                                   Dave



More information about the Comp.lang.c mailing list