[Idle-dev] idlefork - horses for courses

StephenM.Gava StephenM.Gava
Sun, 15 Jul 2001 12:17:02 +1000


I've just been reading a flood of messages on the editor vs shell topic (my 
isp had a router problem which caused all my mail to bank up for the last 
day, so now I have hundreds of emails spewing out...).

The shell/editor seem to have been discussed at some points as though they 
were almost mutually exclusive methods of creating a whole program, but I 
certainly don't see them that way at all. 

I certainly found the shell to be an invaluable tool in learning python, but 
then it never occurred to me to somehow think of it as an editor substitute, 
or proxy. I used them for entirely different purposes. Of course one writes 
code to be saved and executed as the final program in an editor, but I've 
found the shell is absolutely invaluable (unbeatable) as tool for 
interactively testing ideas and assumptions about how more 'atomic' code 
'phrases' (or even individual keywords or library functions) will behave, in 
parallel to using these constructs in the edited source file. 

In fact, if one is unsure about exactly how a particular language construct 
will behave in given circumstances (ie. the position a learner is certainly 
frequently in), then throwing a few curves at it in the shell gives you a 
much more certain idea of exactly what will happen than just reading the 
documentation on it. 

So definitely both should be available and should be used in teaching and 
learning python, but for different and complimentary purposes. This, I 
believe, is more an issue of being able to teach effective use of the 
language tools for learning the language than anything else. Far from being 
something for 'experts', the shell should be introduced to beginners as a 
great learning tool, as and aid and adjunct to source file editing.

I guess two possible shortcommings to what I've said here could be that, 1) I 
already programmed in many other languages before python, so I wasn't a true 
beginner, and, 2) I was initially using the shell in a linux console, so it 
had all the luxuries of readline command line editing and recall, etc., which 
isn't normally available in a shell invoked in a dos console under windows, 
thus making the shell a more attractive tool on *nix style systems. 

Case 2) is easily answered by using the IDLE shell which comes with all the 
trimmings and more (like easy copying and pasting back to the editor), on all 
platforms. As for issue 1), well, I recently began teaching my youngest son 
programming in python, he hadn't programmed before, and I found that after 
the basic concepts, when I introduced him to using both the documents _and_ 
trying things in the shell to work out stuff you are unsure of out, he was 
quickly able to use those two resources in combination to bootstrap his own 
learning process. He found that trying statements in the shell and getting 
instant feedback as he changed parameters, etc., really helped him to work 
out what to type into his larger body of code in the editor, quite separately 
from running/testing  each step of his edited code's 'evolution'.

Of course the shell can be used for more advanced kinds of experimentation 
and 'instant gratification' one off code executions, but I think that 
properly teaching learners its benefits as an exploration tool can only help 
them to become better python programmer much faster.

Hmm, enough rabbiting on, now to plunge further into my email backlog!

Cheers,
Stephen.
-- 
Stephen M. Gava
<elguavas@users.sourceforge.net>
"More power to those who don't care for it." - anon