Exceptional Style

Posted on February 15th, 2006 in Technology by Craig

If you’re a programmer, perhaps you remember the famous paper by Edsger Dijkstra, “Go To statement considered harmful.” Sometimes I think that paper could now be written as “Exception statement considered harmful,” especially when I see Python code that looks approximately like this:

try:
  try:
    do some thing
    try:
       # comment
        try:
           loop()
    except e:
      raise
  finally:
  . . .

Well, you get the idea. And it would be just as amusing if it were in C++.