Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!topaz.rutgers.edu!ron From: ron@topaz.rutgers.edu (Ron Natalie) Newsgroups: comp.lang.c Subject: Re: goto's in C: an opinion... Message-ID: <13407@topaz.rutgers.edu> Date: Mon, 20-Jul-87 17:50:56 EDT Article-I.D.: topaz.13407 Posted: Mon Jul 20 17:50:56 1987 Date-Received: Wed, 22-Jul-87 00:45:48 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 14 Keywords: C, goto, style > A large myth from the 70's, where structured programming was viewed > as "no gotos", was that forward jumps out of loops were not structured. > This is not true. A break transfers control to a known place and provides > just as structured a piece of code as a while leaving the loop on a false > condition. No, it is the break or jump to varying levels of loop exit that causes problems. Generally a good test for structure is to make each executable statement a point and draw lines indicating the possible paths from one point to another point. If the lines must cross, then you are losing structure (in the "everything is deeply intertwingled" terminology of DeMarco). -Ron