D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Python OOP

 

I'm not sure that OOP will suddenly "click". It took me a while to really get 
it. Now it is second nature.

OO was heralded as the silver bullet of the 1990s. It is not, of course. Much 
of it is over used and results in clumsy contrived code. Java suffers from 
this, as you can only have objects in Java. C++, which also allows mixed 
procedural / OO code, can be pretty horrible.

Python is a good one to start with because it is elegantly simple, and does 
not force you to use OOP; you can happily mix in procedural code.

It does have some oddities, such as the ability to bind methods to instances 
of objects, rather than the class. That is very weird if you come from a 
statically typed language background.

The Python tutorial at http://docs.python.org/tut/tut.html is as good a place 
to start as any. Don't worry too much about the OO stuff. It will come to 
you.

In Python (one of the things it is criticised for) you pass around an 
explicit "self" pointer ("this" in C++ etc.). This, in fact, makes it easier 
to see what is going on in terms of classes.

What languages have you used before? And, as Tom asks, what are you trying to 
do with it?

D

On Thursday 29 November 2007 16:02:47 Neil Winchurst wrote:
> I have used several programming languages over many years. The most
> recent one is Python, which is the first to include OOP. I have tried
> ever so hard to get to grips with classes etc, but there must be a
> blind spot somewhere.
>
> I have tried several books and teaching sites on the internet. I still
> have problems, must be getting thicker in my old age.
>
> Does anyone have any favourite books, web sites etc which I might try
> to get my head round this please? There must be one out there somewhere
> which will cause it all to suddenly 'click'. (Or perhaps I am past
> hope.)
>
> Thanks
>
> Neil Winchurst

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html