[Idle-dev] Making Python Speech-Friendly Under IDLE

David Scherer dscherer@milliway.kssacct.com
Thu, 7 Dec 2000 14:17:22 +0000 (GMT)


> > "if x not equal y colon; tab if x less than 3 colon; tab tab x equals x plus
> > 1; tab x equals x plus y"
> 
> That's what I was envisioning as easiest and perhaps best solution.

The problem is that, unlike in "visual" programming, you are required to
remember the current indentation level, which takes up one *very* precious
short-term memory slot and adds an opportunity for misinterpretation.  It
might also be hard to reliably tell the difference between, say, "tab tab
tab tab" and "tab tab tab tab tab".

I think Tim's "open-block" and "close-block" would be better,
however we spell them.  It's possible to interpret block structure
without knowing the absolute indentation level, e.g.

void main() { short x; if (x>0) { while (x) { x = x-1; } } }

Indentation is better than this precisely because it's a visual effect
that clearly groups statements together without interfering with their
meaning or requiring you to keep extra information in your head.  The only
analogous thing I can think of in the audio domain is pitch.

> What a cool idea.  I'd never thought of that.  How well would it work
> for the non-musical or those who have never played an instrument?

If it works at all, I doubt it would depend on musical talent.  Remember,
the *key* point is that you can recognize indents and dedents, which would
be changes in pitch up and down, respectively.

If you have a speech synthesizer that can vary its pitch in response to
control commands of some kind, you could test the effect by coding samples
of Python by hand.  If you don't have such a synthesizer, that's an
obvious technical obstacle to implementing this idea :)

Dave