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: 103376,14f7200925acb579 X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: No Go To's Forever! Date: 2000/03/22 Message-ID: <38D9328A.EB464D75@earthlink.net>#1/1 X-Deja-AN: 601006504 Content-Transfer-Encoding: 7bit References: <38D7B41D.B3494C6A@lmco.com> <8b8m2e$8201@news.cis.okstate.edu> <8b9fk3$l18$1@nnrp1.deja.com> <38D8DFC2.778826FB@cadence.com> <8barci$4ks$1@nnrp1.deja.com> <38D92246.9B53E842@pacbell.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 953758145 209.179.250.129 (Wed, 22 Mar 2000 12:49:05 PST) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 NNTP-Posting-Date: Wed, 22 Mar 2000 12:49:05 PST Newsgroups: comp.lang.ada Date: 2000-03-22T00:00:00+00:00 List-Id: "Michael P. Walsh" wrote: > -- snip > > People are quite capable of writing good code in assembly > language, but it is likely to be quite hard to read and > understand unless it is well commented. > > -- snip It is true that nearly any computer language creates the possibility of writing well structured code. The problem come from a little thing that Linguists call Zipf's law. Basically it says that people prefer to do things that are easy, and language tends to structure itself to make easy those things that people do frequently. At this point I tend to apply the weak form of Whorf's law, which states (essentially) if there are two ways to think about something, people will tend to choose to think about it in the way most harmonious with their most familiar linguistic habits. In other words, if you get into the habit of using goto's, you will tend to become more comfortable with using them. And if it is twice as hard to write well structured code, you will tend to write unstructured code. To elaborate on the matter, if code is written first in a quick and dirty fashion, with the intention of cleaning it up once you get it working, it will probably never get cleaned. So the better environment is the one that makes it easy to write it correctly the first time. I don't like goto label constructs unless the label MUST be attached to a well-marked feature, like the beginning or end of a loop or routine, and those feature had better be well marked for manyn other reasons than the goto label. If the label just happens to be at the start or end of the routine, and not attached to it, then it might be advantageous to insert intervening statements for cleanup or initialization. And they may become modified by code repairs. And all of a sudden you notice that the code doesn't look very structured at all. Let's just get off this slope! I support continue