Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-beacon!eru!kth.se!sunic!mcsun!i2unix!dist.dist.unige.it!foobar From: foobar@dist.dist.unige.it (Maurizio Vitale) Newsgroups: comp.object Subject: Re: Documenting OO Systems Keywords: operators Message-ID: <1991Mar30.083135.2460@dist.unige.it> Date: 30 Mar 91 08:31:35 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> , jls@rutabaga.Rational.COM (Jim Showalter) writes: |> >One thing i like about C is that when you type something you know what it's |> >going to do. |> |> Okay, what is this going to do?: |> |> int j (int y, int m, int d) { |> int m_d[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; |> if (m<1 || m>12) return 0; |> int l = !(y%4) && y&400; |> if (d<1 || d>(m_d[m-1] + (m==2 && y))) return 0; |> int dd = 0; |> for (int i=0; i return dd + d + (m>2 && y); |> } |> |> You should be able to tell me right off the bat--you think English sucks |> as a programming language, and this is DEFINITELY not written in English. |> -- |> ***** DISCLAIMER: The opinions expressed herein are my own, except in |> the realm of software engineering, in which case I've borrowed |> them from incredibly smart people. I absoulutely do not want to start a flame war, but please do consider: 1. It has only take a double read of your code (please trust me) to understand that your function does return the number of days elapsed between the 1.st of january of the year and the date it is given has argument (providethey are in the same year, no check, limited usefulness, definetly bad SWE). The double read has been due to the fact that I was biased from the first lines into thinking that the function returned the day of the week, the last lines cleared this out and the second read confirmed the new interpretation. 2. Giving variables single letters name (even if at least onest initials) is definetly bad programming practice in *ANY* language. 3. English (as any other naural language for that matter) is definetly *NOT* a good programming language. Take some good writer (expecially philosophers) and try to understand at the first read what they are saying. Then try to find more than two people and a computer who understand the same thing from what they had read. Either you've got the point or you'll definetly never get it. 4. The original poster did mean that the *one* who write the code is able to understand what the computer will do of it, *NOT* that anyone is able to tell at the first glance what someone else write down. 5. I hope that the "incredibly smart people" have some more substantial opinion in the "realm of software engineering" over those they have passed to you. To end my argument I hope that people end arguing which language is the best to write bad code and start writing good code (the really brave could carry on producing better languages) I will not answer to more than one follow up to this since I've more important things to do in my spare time. Maurizio -- ---------- e-mail: Maurizio.Vitale@dist.dist.unige.it s-mail: Maurizio Vitale via Monaco Simone 1/14 16148 - GENOVA ITALIA