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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: "Robert Martin" Subject: Re: Software landmines (loops) Date: 1998/09/05 Message-ID: <6ssb20$c99$1@hirame.wwa.com>#1/1 X-Deja-AN: 388251846 References: <35f23ce2.7649859@news.erols.com> <6snn1b$c90$1@hirame.wwa.com> <35ef7dff.24318728@news.erols.com> <35f79e53.98130474@news.erols.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: WorldWide Access - Midwestern Internet Services - www.wwa.com Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-05T00:00:00+00:00 List-Id: Matthew Heaney wrote in message ... >I've been flipping through Structured Programming, by Linger, Mills, and >Witt (Addison-Wesley, 1979), which I read a couple of years ago. In >Chap 3 they list a few control structures, among them: > >The dowhiledo structure >So we see that the middle exit loop construct really does fit the >definition of "structured." According to Harlan Mills. But not according to Dijkstra. >Conclusion: Feel free to exit from the middle of a loop. No, you should not feel free to do anything. You should weigh the costs of everything you do. You should not feel free to use top-exit loops, you should not feel free to use 'exceptions', you should not feel free to use 'templates', etc, etc. Everything has a cost/benefit value that needs to be assessed. Once making that assessment, you *decide* to use certain structures. And if you *decide* to use mid-exit loops, so be it. But the decision should *never* be: "I used it because it is part of structured programming", or "I used it because its part of object oriented programming", or "I used it because it is a well known design pattern". > This form of >loop stands as a peer to other forms, among them the whiledo and dountil >constructs. If anyone argues that "oh, but it's not structured," then >hand them a copy of Mills' book. I haven't read this book, so I can't say if it is good or bad. Probably it is very good. However, I don't recognize Mill's authority to add to the definition of SP. Dijkstra coined the term, he has the right to say what gets added to it, and what gets taken away from it. I would admit to dowhiledo being part of SP if dowhiledo fell into the common usage of SP. Unfortunately, you posted some 14 or more definitions that were part of the common usage of SP. Those 14 definition, in one way or another, encompassed *all* of programming; making common usage meaningless. That makes me want to go back to the originator and stick to his definition. BTW, if every you use a programming structure that you have thought through and decided to used based upon your judgement of the situation, and then someone else wrinkles up their nose and says "but its not structured programming", you have the perfect right to say: "So what?". *You* are the engineer, *You* are responsible, *You* make the decision. But you'd better understand the cost/benefit trade-off. Robert C. Martin | Design Consulting | Training courses offered: Object Mentor | rmartin@oma.com | Object Oriented Design 14619 N Somerset Cr | Tel: (800) 338-6716 | C++ Green Oaks IL 60048 | Fax: (847) 918-1023 | http://www.oma.com "One of the great commandments of science is: 'Mistrust arguments from authority.'" -- Carl Sagan