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: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Software landmines (loops) Date: 1998/09/16 Message-ID: #1/1 X-Deja-AN: 391791123 Sender: matt@mheaney.ni.net References: <35f51e53.480 <904556531.66622 NNTP-Posting-Date: Wed, 16 Sep 1998 11:39:57 PDT Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-16T00:00:00+00:00 List-Id: duncan@yc.estec.esa.nlx writes: > One issue which I haven't yet seen addressed in this thread (but then > our news feed is particularly patchy) is abnormal flow of control. > > As far as I can see, the single entry/single exit paradigm assumes > that there is a simple flow of control, through the code as you can > see it. So far, nobody has made any comment on "abnormal" flow of > control, such as interrupts, multi-threading, and what might be more > interesting in these news groups, exceptions. This has been discussed wrt resource management. Robert Martin argued against early returns (or middle-exit loops) by stating that you might forget to release a resource, if you return early. I gave the counter-example that the resource management problem should be solved another way, by using a deconstructor (C++) or a controlled type (Ada95). I based my arguement on the fact that this is what you should do no matter what, because of the presence of exceptions. Stroustrup calls this idiom "resource acquistion is initialization."