[Edu-sig] more pythonic algebra

kirby urner kirby.urner at gmail.com
Fri May 15 19:12:36 CEST 2009


In a mathy approach to Python, it makes sense to go:

a) welcome to the shell, (print("Hello World!") etc.
b) this is a tool bench (for adults, cycle shop talk (more below))
c) import math

The reasoning is this:  we're in a POSIX or unixy context and want to
get across the "many tools each doing one simple thing well".  We're
not afraid of bash at this level i.e. this is not an immersive
environment where we seek to protect from the nasty evil bare OS API.
On the contrary, we like futzing in C.

So the "tool bench" metaphor (or "work bench") inherits from there,
where "cycle shop talk" means like for bicycle repair.

Unixy geeks have this no nonsense kind of retro workbench aesthetic
that feels rather wood-worky, you probably know what I mean, and these
overtones matter when we start making the cartoons, comix (e.g. xkcd).
**

In notes for the teacher, lets make clear this isn't like PLT Scheme
where the aim is to start with a "simplified" version of the language
and gradually add features.  The bootup space of __builtins__ is full
of professional tools, but minimalist and not "just the easy to
understand ones" or something like that.

The idea that a fresh boot into the shell puts you in "beginner-ville"
is somewhat antithetical to Python's design and story of origin, so
lets not encourage that misconception among teachers.

However, this is algebra, so right away it's on to (c) and import
math, at which point other lesson plans kick in.

The idea with 'import math' is we're doing a dir( ) both "before" and
"after" in the shell.

The concept of "namespace" is going to be integral within mathematics
itself, moving forward.

So-called "dot notation" is a core concept here (you'd be amazed how
many algebra books avoid it, to their lasting detriment after a
certain cut-off date, given their competition).

The first day of math class probably involves lots of 'import x from y
as z' versus just 'import x' versus 'import some.package.primegens' or
whatever i.e. getting that syntax all clarified.  Then we jump into
functions right away, per Litvins, e.g. f(x) -- meaning another hour
on args (that could be day 2 or 3 maybe -- or spread it out more, per
Saxon).

Next I'll archive a recent interaction with the J-software community,
another math teaching language used for algebra in some schools,
coffee shops or whatever.

Kirby

** example cartoon:

key concept: "to import a module is like typing everything in it at
your shell, adding to your namespace"

animation:

normal kid suddenly superhumanly fast, rattling keys 300/minute,
entering 'import this' or whatever, say something really long (lots of
variations -- the point is to emphasize top-to-bottom execution of .py
upon import with .pyc generation, presuming CPython, and adding to
top-level namespace -- yes, this is more like 'import *').


More information about the Edu-sig mailing list