[Edu-sig] Setting a variable's value

kirby urner kirby.urner at gmail.com
Thu May 11 23:19:09 CEST 2006


On 5/11/06, John Zelle <john.zelle at wartburg.edu> wrote:
> On Thursday 11 May 2006 09:18, kirby urner wrote:
> > > I don't believe in adding special notation specifically designed for
> > > beginner's sake - even though I am dedicated in making Python as easy
> > > to learn as possible.
> > >
> > > André
> >
> > Right
>
> Agreed. But I personally feel that = for assignment _is_ a bad idea, precisely
> because it does conflict with an older, equally valid, completely entrenched,
> and closely related uses of this symbol. One of the most common mistakes I
> still see (and make) is using = in conditions where == is needed. At least
> that's a syntax error in Python. The use of = is a poor desgin decision made
> by earlier languages and  then borrowed by Python. I can live with it, but
> it's still a mistake.

I think = was the most obvious single-character candidate, and in the
interests of economy was chosen to keep Python spare, just like we
don't need curly braces or semi-colon line endings, and enjoy
complaining about some extraneous syntactic sugar colons scattered
here and there.

Also, let's admit it, mathematicians enjoy a lot of ambiguity in their
notations, given the high end hardware they get to take for granted,
and have allowed their equal sign to double as an assignment operator
when convenient.

They say "let x = expression" which 'let' actually made it over into
BASIC (I think BASIC is what happens when you let academic committees
design your language:  a hodge-podge (which *is* a mistake)).

> > Also, math notations which went to the trouble to be self-executing on
> > a machine (like APL), in some sense deserve our respect for their
> > precision and consistency.
> >

Mathematica too.  You'll find lots of literature about how
mathematicians get to be sloppy, given the very high end parsers they
could take for granted.

*We* know from context whether m(q - 1) is q-1 being passed to
function m, or a product of two multiplicands, m and (q-1).

But Mathematica had to disambiguate within its most dogmatic
formalisms -- with an option to output in "sloppy" for the benefit of
the computer ignorant..

> > Maybe it's plain old, non-executing (dead) algebra that should change.
>
> Give me a break here. If Python had used + to mean subtraction, would you say
> that's not a design flaw even though + means addition everywhere else in the
> world? That's just silly.  = means equality, always has and always will in
> mathematics. Why should that change?

As I've said, it's polymorphic in mathematics as well.

But yes, point granted, some mappings of ASCII to common math
operations would have been subgenius, such as using & for division
(although J, unlike most languages, does use %, since / was already
taken).

> > Phase in Python notation much earlier and discuss the old pre-Python
> > use of the assignment operator as "from a different namespace"
> > (perhaps deprecated).
> >
> > Just because a bunch of oldies used typography the way they did,
> > doesn't mean we have to warp everything we do in future to be backward
> > compatible.
> >
> > I look at self-executing math notations as defining a cutting edge,
> > not as poor imitators of some obsolote text book way of doing things.
>
> But self-executing is not the same as self-manipulating. Algebra is much more
> a symbolic activity than it is a numeric activity. We should use notations
> for algebra that best lend themselves to algebraic manipulation, not those
> that are necessarily best for computing results.

And that would be Mathematica.  So we already know: standard text book
algebra notation failed the reality check.  It wasn't good enough.  A
more formal, more rigorous notation was needed.

Ergo my point:  I don't look to mathematicians to tell me how to write
math, but to computer scientists such as Kenneth Iverson.  Although
sure, I'll take suggestions from math PhD peanut gallery.

But face it, most of them don't accept dot notation as a valid
extension of mathematics (sheesh) and still think propositional
calculus and modal logic are more important formalizations than OO --
mainly because they can't take a lot of credit for OO.

Very peevish of them, and our kids suffer:  no OO in K-12, but still
lots of creaky old set theory (but minus its key application in SQL).
An ugly situation.  I have falling respect for the math teaching guild
(well documented).[1]

> > In fact, why do we teach "algebra" at all in the old fashioned sense?
> Because you need to be able to do algebra to figure out how to write (good)
> code. It doesn't matter much what system is interpreting that code.
>
> > In my view, tackling this set of topics without a computer language is
> > indefensible except in cases where some invading/conquering power has
> > an agenda of keeping the kids dumb (in which case, the *real* schools
> > have to go underground, as is happening in the USA).
>
> I fear the day that my students have no exposure to algebra outside of the
> sphere of computer programming. I agree with Kirby that teaching with a

I fear the status quo much more.

> programming approach can be a great complement to traditional approaches, but
> I don't think that work on the computer produces the exact same skill set,

Exactly.  The "exact same skill set" is what we *don't* want to
propagate.  Not useful at this time.  Need different skill sets, the
sooner the better.  Silicon Forest talking.

> especially pattern recognition and symbolic thinking, that plain old algebra
> and geometry do. Good geometry students make good programmers.
>
> --John

Good computer graphics programmers usually end up being competent in
geometry as well.

Maybe we should try running the pipeline in reverse for a change, and
let technology come first (wow, train kids in the power tools of their
own culture, what a concept!)?

That's what I'm doing, and I'm getting good results.

Kirby

[1]  For example, just earlier today...
http://controlroom.blogspot.com/2006/05/memo-to-math-teachers.html


More information about the Edu-sig mailing list