[Tutor] creating variables at runtime [interactivity and programming]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Fri, 25 Jan 2002 00:00:31 -0800 (PST)


On Thu, 24 Jan 2002, Kirby Urner wrote:

> my college years (long ago).  FORTRAN was batch programming. I'd punch
> a stack of cards (icky) and they'd go through a card reader with a
> bunch of other programs (JCL cards in between to tell the jobs apart),
> and 20 minutes later, the line printer would come back with my results
> (and/or bug reports).  APL was on a CRT, and I'd sit at the keyboard,
> enter a weird-looking expression that might do quite a lot in one line
> (like Python can), and zingo zango, I get a result immediately.

[... some text cut...]

> That's how I best like to use Python.  It's also how I like to
> learn/play with Python.  Enter stuff and get an immediate reply.  I
> think from a learning standpoint, having an interactive shell makes a
> *huge* difference.


There's a quote from Paul Graham's introduction to "ANSI Common Lisp" that
seems somewhat relevant:

    "... [The pervasiveness of bugs] is just what the new model of
programming does assume.  Instead of hoping that people won't make
mistakes, it tries to make the cost of mistakes very low.  The cost of a
mistake is the time required to correct it.  With powerful languages and
good programming environments, this cost can be greatly reduced.  
Programming style can then depend less on planning and more on
exploration..."


When we're learning something, that's especially a ripe time for making
mistakes.  *grin* But that's where an interpreter shines: it allows us to
experiment with our mistakes, and makes casual exploration possible.