Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ukma!psuvm.bitnet!uh2 From: UH2@PSUVM.BITNET (Lee Sailer) Newsgroups: comp.software-eng Subject: Re: Control flow and common sense Message-ID: <41445UH2@PSUVM> Date: 4 May 88 13:17:15 GMT References: <4605@ihlpf.ATT.COM> Organization: Penn Sate Erie--School of Business Lines: 19 In article <4605@ihlpf.ATT.COM>, warren@ihlpf.ATT.COM (Montgomery) says: > >nested if-then-else's. At the leaves of the if-then-elses were >statements that did something and generally set variables tested by >the if-then-elses, possibly also setting the loop condition. The >structure being implemented was actually a finite state machine, and >fairly simple to understand as such, but impossible to discern from >the style in which it was written. This is where "literate programming" should come in. Perhaps if the author had written a long comment that said something like, "I've implemented a fsm using deeply nested if-then-elses. At the end of each if-then-else is a block of statements that do stuff, and set the state variables for the next go around. I could have uses case stements but didn't because. etc etc etc," then it wouldn't have been necessary for you to "discern" the fsm from the structure of the code. Now, this also presumes a certain degree of expertise on the part of the reade, who has to know what a fsm is, and how to program one. lee