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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public From: smize@news.imagin.net (Samuel Mize) Subject: Re: Software landmines (loops) Date: 1998/09/04 Message-ID: <6spia2$1s36$1@prime.imagin.net>#1/1 X-Deja-AN: 387959901 References: <6rf59b$2ud$1@nnrp1.dejanews.com> <6sjnlu$83l$1@hirame.wwa.com> Organization: ImagiNet Communications Ltd, Arlington, Texas Reply-To: smize@imagin.net (Samuel Mize) Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-04T00:00:00+00:00 List-Id: In article , Joe Gwinn wrote: >The issues are in my experience quite independent. I have seen lots of >spaghetti code with nary a GOTO, and perfectly clear code with many GOTOs. > >I would submit that good programmers write clear, simple code, regardless [of language used] This is certainly true. >...The key issue is clarity of thought; Well, clarity of thought and clarity of exposition. A complex bit of code may be clear in one's mind, but be the devil to recall or decrypt for later debugging or maintenance changes. One benefit from structured programming is to make everyone use a simpler, common "language" of programming -- a set of idioms that will simplify communication with other programmers, including ourselves in later time. Humpty Dumpty had perfectly clear thoughts, but he didn't use the agreed-to language, so his thoughts weren't clear to others. ...So, the whole 1970s debate about structured programming (and thus GOTOs) >reduced to the fond hope that if we tied the hands of those lost-puppy >programmers, they would no longer be lost, and would then think ahead and >write good code. Well, I suppose that's a fair representation of the overblown claims that some people made for it. I understood it to be an attempt to codify the heuristics that better programmers use, so neophytes could learn more easily how to code clearly. It goes hand-in-glove, necessarily, with structured design, which is a similar attempt to codify how better programmers organize their thinking before they code. But I had the good fortune to have structured programming presented, not as a set of language constructs, but as one of a number of useful ways of organizing one's thinking. Others would be functional, logic, and object-oriented programming. Note that code in LISP isn't necessarily functional, and gotoless code isn't necessarily structured. The core intuition was always that the program should HAVE structure; that you should be able to easily see how it is organized, and how it organizes its activities. It shouldn't be just a stream-of-consciousness sequence of instructions. Structured programming isn't necessarily single-entry-single-exit, or gotoless programming, although those sub-flavors do exist. Further, within a project or team, you should have an agreed-to set of structures, so you can interchange code easily. It's like teaching a new carpenter how to build a standard wall with studs and sheet rock. There are a lot of other ways to build a wall, and for some walls another method is better. But it's wise to teach a student the standard methods first, and teach them how and why they work (and when and why they DON'T work), before you turn him loose on a building. Further, if he builds a weird-style wall, no matter how good a wall it is, the electricians and plumbers won't know how to work with it. I've always felt my institution (Kansas State University) did a really remarkable job of providing a sensible, pragmatic introduction to a lot of technologies. I also like how one of my professors described some of the programs he saw: apparently they gather a pack of discarded, mispunched cards left behind by other students, slap a JCL card on the front, then try to debug it. Best, Sam Mize -- Samuel Mize -- smize@imagin.net (home email) -- Team Ada Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam