Re:Confessions of a terrible programmer
by parenthesis on Saturday March 14, 2009 @06:59PM
(#516277)
E.g.:
clisp> (macroexpand '(dotimes (i n) blah blah blah))
(BLOCK NIL
(LET ((I 0) (#:COUNT-2814 N))
(TAGBODY
#:LOOP-2815
(IF (>= I #:COUNT-2814)
(GO #:END-2816))
BLAH BLAH BLAH
(PSETQ I (1+ I))
(GO #:LOOP-2815)
#:END-2816
(RETURN-FROM NIL (PROGN NIL)))))
(goto in Common Lisp is (go ...) )Of course we all understand (or are forced to use) structures now, but back then GOTOs were evil. We did not have the structural classics we have now. We had to build them. (and use them).
Naked GOTOs were indeed evil and led to endless loops and sleepless nights. There was no structure to them.
Pascal was our savior.
GOTO isn't evil, it just has no meaningful context without a comment or convention. All the classic 'structured programming' control structures are nothing but simple conjugations of conditional GOTOs -- what they provide is idiomatic context.