Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!ftpbox!motsrd!motcid!horvath From: horvath@motcid.UUCP (Bob Horvath) Newsgroups: comp.object Subject: Re: Documenting OO Systems Keywords: operators Message-ID: <6108@lead2.UUCP> Date: 2 Apr 91 00:24:47 GMT References: <299@orbit.gtephx.UUCP> <1991Mar25.145441.1@happy.colorado.edu> <20106@alice.att.com> <3481@engadm3.csd.mot.com> <1991Mar26.191259.14470@i88.isc.com> <4693@osc.COM> 12) return 0; -int leap = !(year%4) && year&400; -if (day<1 || day>(month_days[month-1] + (month==2 && year))) return 0; -int dayofmonth = 0; -for (int i=0; i2 && year); -} -I've left the name of the function cryptic, but the rest is the result -of a simple global substitution. It becomes immediately apparent not -only what the function is supposed to do, but that it contains at -least one error (surely you meant to check (month==2 && leap)). -Funny thing is, the function is still written in C. Having read the rest of the posts I now know what it does. Reading it with the variables changed gave me a clue that it did something with days, months, and years and the amount of days in a month. But not being a regular C programmer, I still wasn't able to *quickly* figure out exactly what it was doing. -Amazing, isn't it? I don't think so. Even during times when I was working in C I was never able to read it as easily as other languages.