Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!comp.vuw.ac.nz!am.dsir.govt.nz!dsiramd!marcamd!mercury!fivegl!hugh From: hugh@fivegl.co.nz (Hugh Grierson) Newsgroups: comp.lang.c Subject: Re: need "yy-ddd-hh:mm:ss ==> (time_t) clock" converter Message-ID: <1991Feb18.133937.28469@fivegl.co.nz> Date: 18 Feb 91 13:39:37 GMT References: <368@bria> <6586@gssc.UUCP> <2323@stsci.EDU> Reply-To: hugh@fivegl.co.nz (Hugh Grierson) Distribution: comp Organization: 5GL International Ltd, Auckland, New Zealand Lines: 21 In article <2323@stsci.EDU> ansok@stsci.EDU (Gary Ansok) writes: >In article <6586@gssc.UUCP> timr@gssc.UUCP (Tim Roberts) writes: >>> int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; >>int mdays[12] = { 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; >This is likely to go off into a "speed vs. style" war, but I tend to >agree with those who say that unless this is a very time-critical >piece of code (hard to imagine for a date conversion routine, but I >suppose it's possible), the benefits of the first in readability and >maintainability far outweigh any speed gained by the second. Maintainability???? How often *do* you have to change the number of days in a month????? (Sept 1752 notwithstanding) Readability? A one-line comment... -- Hugh Grierson hugh@fivegl.co.nz | Perfection is attained not when there is 5GL International Ltd, | no more that can be added, but when there Auckland, New Zealand | is no more that can be taken away.