Is Python an object based programming langauge?

Anton Vredegoor anton at vredegoor.doge.nl
Wed Mar 13 07:59:28 EST 2002


On 11 Mar 2002 07:31:55 -0800, drevenhaug at hotmail.com (Graz Bukanoff)
wrote:

>Is Python an object based programming langauge?

Short answer:

Yes, but at least for me there can be some confusion originating from
factors that have to do with graphical user interfaces.

Long answer:

Some modern programming IDE's (integrated development environments)
are trying to adapt the way user thinks to the way the computer works.
A computer is a thing that is in an infinite loop where sometimes
events can trigger certain actions. 

For example in the old days of Borland Pascal or Borland C it was easy
to write a program that did certain things and then exited. 

Now with modern Delphi or C++ Builder its a real accomplishment to
write such a program. It goes directly against the paradigm of always
creating a form (a form is a container for graphical objects) whether
one needs one or not, and since forms are reacting to events one has
to generate an exiting event. In this view it's also natural to view
graphical things on the screen as objects, and to have objects react
to events. (user clicks button)

This idea has become very pervasive and can  be seen in other IDE's
that are of the GUI kind (graphical user interface). In python most of
the time objects are not connected to graphical elements on the
screen. In Delphi, C++ Builder and Visual Basic there are also non
graphical objects, but these IDE's *start* with graphical objects and
introduce other objects later. 

In python it is the other way around: It is possible to have graphical
objects and infinite loops and events but a starting python script is
often more like the "old" way of programming. This makes it easy to
try things out. Complex loops and graphics can be added later.

Both ways of designing programs have some advantages. Different ways
of viewing objects -as graphics reacting to events or as
datacontainers reacting to methodcalls-  can be appropriate. A program
can be nongraphic but still be object oriented and reacting to events,
for example a webserver. The resulting confusion sometimes leads to
not recognizing the object oriented (or object based?) nature of other
language-IDE combinations.

On the other hand its entirely possible that the source of the
confusion is something completely different.

Anton.



More information about the Python-list mailing list