From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,92c39a3be0a7f17d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-14 05:33:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed.nyc.globix.net!news.stealth.net!news.stealth.net!news-east.rr.com!news-west.rr.com!news.airnews.net!cabal10.airnews.net!cabal1.airnews.net!news-f.iadfw.net!usenet From: "John R. Strohm" Newsgroups: comp.lang.ada Subject: Re: code partitioning (was: Future with Ada) Date: Thu, 14 Mar 2002 07:27:42 -0800 Organization: Airnews.net! at Internet America Message-ID: <9F6CC4A4404878F6.5B5BBAA9D5258CDF.AA7E4D06ED4F8781@lp.airnews.net> X-Orig-Message-ID: References: X-A-Notice: References line has been trimmed due to 512 byte limitation Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Thu Mar 14 07:32:22 2002 NNTP-Posting-Host: !bn;Q1k-W!WQ+:] (Encoded at Airnews!) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:21225 Date: 2002-03-14T07:27:42-08:00 List-Id: Well, yes, in theory that is all true. In practice, in thirty years of slinging bits, both as student and as professional, I have seen exactly one procedure that NEEDED to be more than one printer page of code and that COULDN'T easily be factored down any further. (For the record, it was the photon torpedo routine in the old Matuszek-Reynolds-McGehearty-Cohen STARTRK game.) "Marin David Condic" wrote in message news:a6lfgd$gj6$1@nh.pace.co.uk... > Well, yea, I could see that - even breaking it up into a "when mammal ... > when others..." case in something like this. It kind of goes to my original > point: You ought to keep ifs and cases short and as unnested as may make > sense for the problem at hand, but don't go crazy. > > You've got to use some judgment, thinking "Shortness and non-nestedness are > good things taken from The Book Of Devoutly To Be Desired Results, but lets > not forget that the spirit of the law is to make things readable and > comprehensible" If statements nest for three or four levels or span several > dozen lines, yet remain comprehensible (being a natural reflection of the > problem at hand) and breaking them up would require unnatural acts of > contortion, then don't fight it. Programming is often an "art" that requires > an "artistic eye" rather than an exact science... much like other writing > and communication skills. > > MDC > -- > Marin David Condic > Senior Software Engineer > Pace Micro Technology Americas www.pacemicro.com > Enabling the digital revolution > e-Mail: marin.condic@pacemicro.com > Web: http://www.mcondic.com/ > > > "Wes Groleau" wrote in message > news:3C8E3110.F36F2DC8@despammed.com... > > > > Without actually endorsing this, here's a sort of > > borderline situation: > > > > case Animal is > > > > when Horse | Tiger | Elephant | Whale | Mouse | > > Dog | Gorilla | Platypus | Koala | Dingo => > > > > Classify_Mammal (Animal); > > > > when Lizard | Snake | Alligator | Tortoise => > > > > Classify_Reptile (Animal); > > > > ...... > > > > when others => > > > > Classify_Some_Really_Wierd_Thing (Animal); > > > > -- gratuitous demo of > > end case (Animal); -- yet another way of > > -- naming a case statement > > > > -- to bring it back to the original topic > > -- now that I've updated the subject line :-) > > > > >