[Edu-sig] re: promoting computer literacy through programming python

Kirby Urner urnerk at qwest.net
Thu Jan 1 19:36:10 EST 2004


> >If so, I think you should be less elliptical.
> 
> I am talking about hosts of things, best summed upped quoteth Mr. Elza:
> 
> """
> Python *is* hard, because programming is hard.
> """
> 
> And if I made the effort I could couch what I am trying to say by coining
> appropriately elliptical and weighty language - "cognitive gestalt", I
> think sounds cool.

It's just that I picked up from your tone that you felt John had left out
something supremely important and relevant.  Yet so far, you're echoing
points he *did* make.  

Thinking like a programmer requires some mental habits that might seem alien
at first.  Yep, no question.

> But I think I am saying things that are incredibly simple, to the point of
> being self-evident.  And frankly only worth saying at all because I read a
> study that has a list of "Disadvantages of Python" and prominently
> mentions zero based indexing. Presumably because it is less intuitive to 
> someone who has never programmed than 1 based indexing.  

Yes, I think you presume correctly.

Also, many programming languages in fact use 1-based indexing.  Python in
many ways displays its C-language heritage, which is not a bad thing.

> As if that common sense observation was sufficient to conclude on the 
> matter.

OK, so you think more should be said.  Sounds good to me.
 
> It seems to me that Python would be a worse language in *all* respects,
> were it to decide to go its on way, on this issue - among others.

At this point, it'd be very difficult, and foolish, to changing the indexing
model, to say the least.  But it wouldn't be alone among programming
languages had it started out using 1-based indexing.  

Changing the division model was likewise difficult, and not foolish because
the case for making the change was more compelling (and wasn't about
pandering to beginners).

> Again, as Mr. Elza says - we are trying to talk to transistors.  Some
> adjustments to our normal methods of communication might only be expected.
> A fact we can hide only so long.

I don't think the transistors compel the semantics in this instance.

> And when we are down to talking about things like zero based indexing we
> are at a point where we are simply far removed from talking about 
> anything that represents the true barriers to getting into communication 
> with the transistors.

OK, sounds like you agree.  The decision to go with 0-based indexing wasn't
directly about hardware (hardware is known to permit otherwise) -- except
Python is written in C and C uses 0-based indexing and is low level (high
level assembler).

The thing with 0-based indexing is it focuses attention on start points.
Array[0] begins at the 0 mark and fills up to the first word (or whatever).


That 0 mark is so important because it's where Array actually starts, and
starting memory addresses are what the computer cares about when retrieving
Array.  

Like even an ordinary ruler starts at 0.  We could have called that first
inch the 0th inch, because we're so fixated on the start points of every
inch.  But when it comes to rulers, we go by the end points, and that first
inch is called 1 (the mark at the other end).

> Red herrings are bad.
> 
> And, if you want elliptical:
> 
> Pickled herring is good.
> 
> Art

So your point, if I may attempt a summary, was that it's somewhat misleading
to confuse the difficulties of learning Python, with the requirements of
hardware?  Programming is hard, but we can only blame so much on the
transistors for these difficulties?

And I agree about pickled herring.

Kirby





More information about the Edu-sig mailing list