GOTO intoxication

Skip Tavakkolian fst at mcgp1.UUCP
Tue Apr 26 06:17:46 AEST 1988


In article <310 at unisv.UUCP>, vanpelt at unisv.UUCP (Mike Van Pelt) writes:
> In article <733 at ambush.UUCP> kimcm at 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 at 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



More information about the Comp.lang.c mailing list