Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mmintl.UUCP Path: utzoo!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: net.lang.c Subject: Re: C Programming Style -- New thought ("writing code") Message-ID: <546@mmintl.UUCP> Date: Mon, 29-Jul-85 15:51:39 EDT Article-I.D.: mmintl.546 Posted: Mon Jul 29 15:51:39 1985 Date-Received: Wed, 31-Jul-85 22:37:51 EDT References: <418@spar.UUCP> <408@utastro.UUCP> <241@frog.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT Lines: 14 Summary: For my next trick ... In article <241@frog.UUCP> john@frog.UUCP (John Woods) writes: >As an example: the recent BYTE article on the TRAVESTY program (a few months >back) included a PASCAL program with a doubly nested loop, which had to use >a logical variable to escape from the inner one (I believe that that required >a double test in the while). I recoded it in C, and came up with half the >number of lines, SIMPLIFIED IT TO A SINGLE LOOP using "C ``tricks''", and >came up with what I felt was vastly more readable code: the whole function >"fit in my mind" at once. If you simplified it to a single loop, it sounds like you changed the algorithm. What happens if you try to reconvert to PASCAL without adding back the extra loop? If this isn't possible, just exactly what "tricks" did you use?