Path: utzoo!mnetor!uunet!pilchuck!ssc!apcisea!mcgp1!fst From: fst@mcgp1.UUCP (Skip Tavakkolian) Newsgroups: comp.lang.c Subject: Re: GOTO intoxication Message-ID: <1334@mcgp1.UUCP> Date: 25 Apr 88 20:17:46 GMT References: <2586@geac.UUCP> <225800022@uxe.cso.uiuc.edu> <733@ambush.UUCP> <310@unisv.UUCP> Organization: Computer Tools Int'l Inc. Lines: 63 Summary: Solutions to the goto dilemma In article <310@unisv.UUCP>, vanpelt@unisv.UUCP (Mike Van Pelt) writes: > In article <733@ambush.UUCP> kimcm@ambush.UUCP (Kim Chr. Madsen) writes: > >Even Mr. Dijkstra had once compared the goto's with alcohol, it's nice > >when used properly, you get headaches when you use it too much and you > >don't give it to minors. > > > Now THAT'S the best description I've heard yet, and from Dijkstra, no > less. Who would have ever thought... > > Now, if we can just get rid of the Carrie Nation types who go around > bashing those few necessary goto's with axes... :-) > -- > Mike Van Pelt Unisys, Silicon Valley vanpelt@unisv.UUCP > Bring back UNIVAC! ...uunet!ubvax!unisv!vanpelt I think I may have a solution or two to the goto dilemma: 1) Language sensitive editors running on a bit-mapped display so that the labels could be printed in larger font sizes (like 96 points :-{) ). For example: # # ### # # ### # # goto # ### # # ### # # # # # # . . . # # # # # ### # # # # do_something(); # # # # # ### # # # This would obviously make debugging easy. 2) Writing a C preprocessor patterned after Ratfor in reverse (lets call it UnratC). which would take goto statements in C and turn them into structured control loops (It is time for another great book from Kernighan and Plauger, the "Software Tools in GNU Lisp, Including UnratC"). If I may make a serious point here, I believe that the use of gotos in machine generated C code is very useful, Since nobody is ``supposed'' to see them. This is the case with some special purpose C ``preprocessors'' which take an embedded statement in something, and convert it to C code. Indeed the gotos made writing something like Ratfor possible (maybe easier?). Sincerely Skip Tavakkolian UUCP ...!uw-beaver!tikal!cti3b1!fst