[Tutor] i++
Danny Yoo
dyoo at cs.wpi.edu
Tue Jun 5 18:40:49 CEST 2007
>> All these values "belong" together. Rather than pass them separately,
>> glue them together as a "structure". In Python, can we use a class to
>> glue things together...
>
> Okay, that makes good sense :) This should be a good exercise for OOP
> Programming :)
Just to clarify: structures and the idea of aggregation are a general
concept that almost all modern programming languages provide. It's not
OOP-specific.
>> There are a few other things to discuss about in the code, but I
>> should let you take a look again and respond before going on. If you
>> have more questions, please feel free to ask the list.
>
> Thanks, I never even expected you to go through the code :)
Code review is at the heart of learning to program better. There's too
much potential in writing code in isolation to do something that looks
like it is doing work, but is either fragile or verbose (or broken!).
I guess I'm trying to make the point: there are things that are bigger and
more important to learn than the best way to increment 'i'. *wink* So
keep your eyes looking out for them.
> I will work at your suggestions and will get back to you if I have any
> problems.
Good! Keep the folks on Python-Tutor up to date with your progress.
More information about the Tutor
mailing list