Tutorial creates confusion about slices

Antoon Pardon apardon at forel.vub.ac.be
Thu Apr 26 05:11:56 EDT 2007


On 2007-04-25, Steve Holden <steve at holdenweb.com> wrote:
> Antoon Pardon wrote:
>> On 2007-04-25, Ant <antroy at gmail.com> wrote:
>>> On Apr 23, 1:38 pm, Antoon Pardon <apar... at forel.vub.ac.be> wrote:
>>>> The following is part of the explanation on slices in the
>>>> tutorial:
>>>>
>>>> The best way to remember how slices work is to think of the indices as
>>> ...
>>>>   +---+---+---+---+---+
>>>>   | H | e | l | p | A |
>>>>   +---+---+---+---+---+
>>>>   0   1   2   3   4   5
>>>>  -5  -4  -3  -2  -1
>>> For a tutorial this is sound advice. A tutorial is designed to give
>>> readers an easy intro to a topic, which is what this achieves. At this
>>> stage the target audience has no idea that extended slices even exist,
>>> let alone that you can use negative indices with them.
>> 
>> OK. But eventually they will come into contact with negative indexes.
>> If they still rely on the above representation for understanding slices
>> that may cause confusions. It is possible that the time lost in clearing
>> up these later confusions will be bigger than the time gained by using
>> this simplification in the tutorial.
>> 
>> So I'm not so sure it is sound advice in this case.
>> 
>> If the consensus is that something like this should remain, I would
>> suggest replacing:
>> 
>>     "The best way to remember how slices work is"
>> 
>> with:
>> 
>>     "A way to remember how slices work, it is not entirly correct
>>      but may be usefull, is"
>> 
>> Or something similar.
>> 
>> 
>> Wording to that effect makes it more clear that it is a crutch
>> that can be usefull now but that it should be discarded later.
>> 
> Most people reading a tutorial are aware that they are being given the 
> knowledge they need to put the subject matter to immediate use, and that 
> there may well be refinements that are glossed over or covered in detail 
> later or elsewhere.

I agree with that.

However there is a difference between information that will help you
on the way now that will be refined later and information that will
help you on the way now and will be contradicted later.

I also understand that the line between the two is rather fuzzy.

In my opinion the text in the tutorial as it stands now, is more
of the latter than of the former type and that is why I would
prefer a change.

-- 
Antoon Pardon



More information about the Python-list mailing list