Introduction object-oriented programming

rzed Dick.Zantow at lexisnexis.com
Fri Jan 17 10:07:36 EST 2003


"Wouter van Marle" <wouterm at spammers-unite-here.com> wrote in message
news:b08ank$dak12 at imsp212.netvigator.com...
> Hi All,
>
> Can anyone recommend me an introduction on object oriented
programming in
> general, and the trick in Python? Preferrably tutorial on the web or
so.
>
> I know the basics of programming (learned BASIC 20 years ago, Turbo
Pascal
> 10 years ago, and recently started Python - never used objects,
never used
> C, and always hobbying. Also a little experience with .BAT and shell
> scripts). So should be a tutorial extending normal programming to
the
> objects.
>
> Without the objects it goes fine, however I have the idea that
objects can
> make things a lot easier - both in design, implementation and
maintenance.
> And now I started off seriously again in an era where object
oriented
> programming is pretty much standard, it is time for me to learn it
too! (so
> I finally understand the mysterious self variable, the __init__
routine, and
> more of those things)
>
> Thanks!
>

I don't really have a recommendation for a specific tutorial on the
Web. There are quite a few, though few (if any) that make use of
Python as the illustrative language. Which is a real shame, because in
my experience, learning Python was the key to learning Object-Oriented
Programming. I can't remember the number of times that I decided it
was time I learned the concept, and then struggled through C++ (and
later, Java) tutorials while the light stayed resolutely off. Python's
syntax is what made the difference: it's clear, it's straightforward,
and it eliminates a whole lot of cruft that obscures the basic
concepts in (many) other languages.

You should know this, though: it's not magic, and it's not *that*
different from what you very likely already did in other languages. I
thought for a long time that I was missing some major concept, but
it's mostly a matter of how you approach the organization of your
programs. Objects have identifiable properties (or attributes or
characteristics or methods or ... ); if they *don't* then they aren't
(and shouldn't be treated as) objects -- or you haven't understood
them properly. Once you do, it's pretty evident what code should go
where, and what it should do. After you've got a few classes tucked
away, it becomes a natural way of thinking about your program's
problem areas.

Using Python lets you see how it all works, quickly and cleanly.
You'll see a lot of OOP in examples and tutorials, though they may
ostensibly be about other things. Work through them, and the pieces
will fall into place on their own, and one day you'll come to realize
that you're doing the OO stuff without worrying about it, and you've
picked up a heck of a lot of other good and useful stuff along the
way.

--
rzed








More information about the Python-list mailing list