[Edu-sig] Python for Algorithms and Data Structures...
Markus Gritsch
gritsch@iue.tuwien.ac.at
Fri, 23 Aug 2002 16:03:34 +0200
Seabrook, Richard wrote:
>
> I think both views have merit. On one hand, pointers aren't essential
> for any particular algorithm, they are a subject in and of themselves
> requiring considerable exposure and experimentation to grasp.
Agreed.
> On the
> other, languages that do not have pointers invariably get into some
> explanation difficulties sooner or later. For example, in Python some
> copying and assignment operations result in two names referring to the
> same object, rather than two unique objects. In languages with pointers
> this is much easier to explain, once students grasp the idea of a pointer.
> Dick S.
I think that the lack of pointers in Python is no shortcoming as long as
you explain to the students, that the assignment operator actually
assigns the *reference* of an object to the new object and that only in
the case of immutable types a new object is created.
For me this is as easy to grasp as the concept of pointers, but probably
it's just a matter of taste.
Being-totally-happy-with-just-references yr's
Markus