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

Kirby Urner urnerk at qwest.net
Fri Jan 2 18:27:31 EST 2004



> -----Original Message-----
> From: Laura Creighton [mailto:lac at strakt.com]
> Sent: Friday, January 02, 2004 6:32 AM
> To: Kirby Urner


> I realise that you are rephrasing what you think Arthur meant, so
> neither of you may believe that but 0-based indexing is 'just a
> cultural convention', but it is not.  It has to do with how you
> visualise the entire problem.  If you are counting, starting with 0,
> then you are almost certainly doing it wrong.
> 

Hi Laura --

I would agree insofar as I should not have used the word "just" (as in
"merely") when saying "cultural convention." 

Such conventions go deep, and do involve perceiving differently, just as you
say.

What I said in an earlier post I think fits with your presentation of the
difference:

   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).

I'll add a picture:


  |<-- 0th -|<--1st --|<-- 2nd -|<-- etc.-|   
  |---------|---------|---------|---------|---------|---------|---------|
  0         1         2         3         4         5         6         7
  |--1st -->|--2nd -->|--3rd -->|--etc.-->|


I think it pays to read some about memory storage, fetching and retrieving
from RAM, address bus, data bus, clock bus -- all that inner guts stuff --
to get some sense of it.

Of course to many language designers this is an anathema as their whole
thing is how you *should never have to* delve deeply into computer guts to
"get it" about a language.  Rather, the language should help you focus on
the "problem space" (not on the computer).

But the fact remains, the computer itself IS the problem space in the
beginning (when languages are being born).

I think John's thesis is good on this, talking about how one of the
advantageous of learning to think like a computer scientist (or a programmer
in particular), is you come to appreciate what the machinery is and is not
capable of (or better:  what humans can and cannot accomplish, given these
tools and limitations).

Kirby






More information about the Edu-sig mailing list