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: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Software landmines (loops) Date: 1998/09/11 Message-ID: #1/1 X-Deja-AN: 390277270 References: <6rf59b$2ud$1@nnrp1.dejanews.com> <6rfra4$rul$1@nnrp1.dejanews.com> <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <904556531.666222@miso.it.uq.edu.au> <6sgror$je8$3@news.indigo.ie> <6sh3qn$9p2$1@hirame.wwa.com> <6simjo$jnh$1@hirame.wwa.com> <35eeea9b.2174586@news.erols.com> <6sjj7n$3rr$1@hirame.wwa.com> <35f055a5.1431187@news.erols.com> <6sjnlu$83l$1@hirame.wwa.com> <6skfs7$2s6$1@hirame.wwa.com> <35F252DD.5187538@earthlink.net> <6sur5m$n9o$1@hirame.wwa.com> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-11T00:00:00+00:00 List-Id: In article <6sur5m$n9o$1@hirame.wwa.com> "Robert Martin" writes: > Dijkstra was quite specific about it. He drew dotted boxes around the flow > charts that depicted the four possible control structures, and showed one > line crossing through the top into the control structure, and another > leaving the control structure and crossing the dotted line at the bottom. Exactly, and exactly what I was talking about. The evil is having two lines into the box, or two lines out. But I also contend, and I certainly never heard anything to the contrary from Dijkstra, that a procedure WHICH IMPLEMENTS A SINGLE CONTROL CONSTRUCT, is a perfect realization of Dijkstra's discipline. In fact, one of my favorite Dijkstra quotes is, "I have a small head and I must live within it." This was said in a discussion of exactly these issues. During the summer of 1980, GE and RPI sponsored a two-day symposium on software engineering. The conference was shortly after the "Green is Ada" announcement. After a session where Dijkstra presented some of his thoughts on software engineering a group including Dijkstra were discussing the control structures in Red, Blue, Green and Yellow. I don't remember exactly which control structure from which language started the discussion. But Dijkstra repeated his statement from the session and went on to explain that what he didn't like about the power of some of these constructs was that they allowed building single control constructions that had dozens of potential paths through them. One of the proposals for how to limit the complexity was to basically draw a line through the flow chart and count threads of control that were crossed. Someone said "One is perfect, two is fine, and three is spaghetti." Everyone laughed, including Dijkstra, and we went on to other topics. Early exits help avoid that definition of spaghetti, while some of the se/se proposals we have seen egregiously violate it. And I think that is a perfect summation of what structured programming is about. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...