[Tutor] Tutorials and How important is pseudocode

Alan Gauld alan.gauld at btinternet.com
Sat Oct 17 01:34:28 CEST 2009

"Katt" <the_only_katala at verizon.net> wrote

>> The most recent one(with a few bug fixes etc) is as per my .sig...
> Thanks Alan G. I got the new version now.  I will go back to the 
> beginning and step through it again.

No, you don;t need to do that, its mainly typos and stuff thats fixed.
There is no radical changes.
I am currently reworking the tutor to v3 of Python and that does
have some major rewrites but the v2 version is only typo chages
and a few bug fixes

> Also, out of curiousity what does everyone think of using pseudocode?

I love pseudocode and use it all the time.

> when I was in a programming class the teacher had us first write the 
> program in pseudocode (writing the code in english) before we actually 
> used real code to create the program.

When I was actually writing production quality code the normal
practice was to do the design down to pseudocode level then
use the pseudocode as comments from which we wrote the
real code. That was in C which is much lower level than Python
so I don;t know if I'd use that approach writing Python. Python
has been called "executable pseudo code" and whjile I don't
go that far, it is far better than C.

But if you are trying to explain an algorithm (or even figure one out)
pseudo code saves you worrying about all the syntactical niceties
For example remembering the colon after an if statement or even that
you should close a file etc. You can also miss out all the try/except
and other error handling, you only focus on what you need to make
it work. Add the other stuff once that has been cracked. Or hide it
in a blanket statemenmt like

   do stuff here
   and more pseudocode stiff
   etc etc...
   handle all errors

The bit between try/except is true pseudocode the rest is just a reminder
that you do need to do some error handling somewhere...


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list