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=2.1 required=5.0 tests=BAYES_40,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: 11390f,4c42ac518eba0bbe X-Google-Attributes: gid11390f,public X-Google-Thread: 103376,4c42ac518eba0bbe X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,4c42ac518eba0bbe X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,4c42ac518eba0bbe X-Google-Attributes: gid1014db,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: Programming language vote - results Date: 1997/12/02 Message-ID: <881106132snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 294679039 References: <343fbb5a.0@news.iprolink.ch> <3470EF6E.F74@lysator.liu.se> <879863453snz@genesis.demon.co.uk> <65gaoj$f8u$1@helios.crest.nt.com> <6616ej$llt@fstgal00.tu-graz.ac.at> X-Mail2News-Path: genesis.demon.co.uk Reply-To: fred@genesis.demon.co.uk X-Mail2News-User: fred@genesis.demon.co.uk X-Complaints-To: abuse@demon.net X-Trace: mail2news.demon.co.uk 881107669 11985 fred genesis.demon.co.uk Organization: none Newsgroups: comp.lang.ada,comp.lang.apl,comp.lang.c,comp.lang.c++ Date: 1997-12-02T00:00:00+00:00 List-Id: In article <6616ej$llt@fstgal00.tu-graz.ac.at> nozone@sbox.tu-graz.ac.at "ANDREAS LEITNER" writes: >Names are snipped (dont know who wrote what, sorry) > >: Whether or not it is appropriate to use a goto depends on the programming >: language---namely, what control structures the language supports. >: If the language only supports GOTO-like structures, then your choice is >: made for you. In other cases it's not that clear. Suppose that you want >: to break out of some deeply nested block statement. If your language >: supports a ``break N'' statement, to break out of N nesting levels, >: or a ``break '' where is the name of the enclosing block >: from which you want to jump out, then you will use the break. If you >: don't have it, you either use a simple goto, or an extra variable plus a >: number >: of tests at each level. > >Well, in my opinion the need to use a goto is in most (if not all) cases a >sign that the design or the language lacks. (if (!design lacks) language >lacks; :) It depends on how often that need arises. If (pulling vague numbers out of the air) a goto is appropriate every 10000 lines of code then the language can't seriously be considered deficient. Trying to eliminate the remaining gotos with manguage extensions would be over-engineering the language and counter-productive. >I think goto debate is not recent anymore is because the majority of people >have accepted the fact that goto provide unreadable code. It isn't a large debate any more because the issues involved are now pretty much understood. goto still has its place but it needs to be used carefully. The situations where it is apporpriate still exist when using a good structured language but are rare. >Once we got a >"coder" that produced lots of gotos, he was fired not onyl because of gotos >but also because of the fact that a different programmer was able to rewrite >a function without using one goto and also reducing the size of the function >from 60 to 15 lines (as I remember correctly) In that case the goto's were just a symptom, the programmer simply didn't know how to program well. He/she would most likely have managed to write bad and inefficient code in a language that doesn't support goto. >I think this is the main reason why the goto-argument is not held anymore >(or is it help by now?) I think many people avoid goto entirely now simply because of peer pressure. To actually type the word in their code would bring them out in a cold sweat! :-) This isn't a response based on reason however. Even in languages that don't support structured constructs to nay great extent (so you can't seriously avoid using goto) you can still write in a structured way. It just takes discipline and a degree of knowledge of how to go about it. -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------