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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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-12 19:54:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.icl.net!newspeer.clara.net!news.clara.net!psiuk-p2!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: code partitioning (was: Future with Ada) Date: Tue, 12 Mar 2002 12:56:26 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: <3C7B0B13.3080003@worldnet.att.net> <3C7D1C89.2000803@home.com> <3C7E7CAD.7070504@mail.com> <3C7FB9D2.D9C6E055@boeing.com> <3C81DF1F.9000503@mail.com> <3C83A112.6080302@mail.com> <3C84223C.A356F466@adaworks.com> <3C853A04.34826F39@despammed.com> <3C8D0D70.BB09F3DA@despammed.com> <3C8E3110.F36F2DC8@despammed.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1015955789 16998 136.170.200.133 (12 Mar 2002 17:56:29 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 12 Mar 2002 17:56:29 GMT 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:21145 Date: 2002-03-12T17:56:29+00:00 List-Id: 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 :-) >