flowcharting is automatic for Python via preprocessor

barnesc at onid.orst.edu barnesc at onid.orst.edu
Tue Aug 3 00:52:43 CEST 2004

I like your idea.

It is easy to get lost inside in eg a multiply nested if statement in a couple
multiply nested for loops, inside a try block.

Sometimes one can split such code into separate functions, and this makes the
code cleaner.  Sometimes not.

However, the real issue is how the eye parses code.

It's really inefficient to scan a whole page of code line by line to understand
where loops, branches, continues, and breaks occur.

I think your visual diagrams could help, if they are:

1. Semantically cleaner.
   IMO, there is too much detail in the flow diagrams.
   (See http://www.getcet.org/images/ex3.png).

   A minimal amount of detail is easier to parse with the eye.

   See http://oregonstate.edu/~barnesc/temp/flow.pdf for a cleaner
   example I came up with.  This doesn't have arrows all over the
   place (and hence may not be a flow diagram), but it does help
   point out the relevant control structures.

2. Integrated into a code editor.

   I could see this being a new code editor fad, like collapsable
   functions and classes.

   It could be quite useful, if the amount of visual information
   is kept minimal, so that the coder is not distracted during

   If the flow diagrams are not integrated into an editor, I don't
   think many coders will use them.

Perhaps editors already do this.

 - Connelly

More information about the Python-list mailing list