<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Keith Dart wrote:
<blockquote cite="mid:20100203211217.19a2ec01@dartworks.biz" type="cite">
  <pre wrap="">But in a language/runtime that has exceptions, like Python, you don't
really need them. Just raise an exception where you would have the
"goto", and catch it where you would have the label. I think that is
even more readable than the goto.</pre>
</blockquote>
Precisely.<br>
<br>
I've also found that in any complex logic where a goto might be called
for, the complexity itself was effectively a bug both in code
transparency as well as in performance.  Rewriting such code to avoid
the use of goto has, in every single case for me, yielded not only more
transparent code, but also a smaller code foot print and more
efficiently running code.<br>
<br>
Flags are a similar issue.  If you need to create, set, and test flags
solely in order to maintain your control flow, then that section of
code almost certainly needs to be redesigned from a higher level, imo.<br>
<br>
I'll admit there are functional exceptions.  In assembler.  And
occasionally those same exceptions can be coded in C.  Things like
processor bootup code, initial stack construction, the framing code
around unix processes, process load code, unexec, certain trampolines
(including those dealing with calls between processor architectures as
with arm/thumb, implementations of shared libraries, kernel/user space
transitions, some kinds of coprocessor support, varying or changing
call semantics, etc), implementations of things like setjmp/longjmp,
exceptions, continuations, jit emulations like qemu, etc.  But aside
from academic curiosity or thrill seeking, I don't see much point or
need for doing so in python.<br>
<br>
I once had a friend who thought it would be cool to write a C compiler
in shell.  To me that's sort of like tearing a Ferrari apart solely
with a pair of pliers.  While it might be possible, and a challenge, it
seems to me that one could find similar challenging possibilities which
<i>also</i> result in useful end products.<br>
<br>
I suppose one could always just declare it to be "art".<br>
<br>
--rich<br>
</body>
</html>