python without OO

michele.simionato at gmail.com michele.simionato at gmail.com
Thu Jan 27 03:24:23 EST 2005


Davor wrote:
> Thanks,
>
> I do not hate OO - I just do not need it for the project size I'm
> dealing with - and the project will eventually become open-source and
> have additional developers - so I would prefer that we all stick to
> "simple procedural" stuff rather than having to deal with a developer
> that will be convincing me that his 50 layers inheritance hierarchy
is
> good since it exists in some weird pattern that he saw somewhere on
> some Java design patterns discussion board :-) and other "proper" OO
> design issues... Once I opted for C++ in a very small project and
> believed everyone will stick with C subset + better type checking
> offered through C++ - but I simply could not manage to keep them off
> using OO stuff which was just making program more complicated than it
> should have been. (note, I am not an experienced developer, nor the
> others I'll be working with (even though some think they are:-)), so
I
> prefer preemptively dealing with issue of everyone showing off their
OO
> design skills)
>

I think Davor is making an important point here: Python has grown in
the last 14 years, and it is no more the simple scripting language
it used to be. In particular, it evolved a lot of OOP "cruft"
(static/classmethods, properties, the __new__ method, super, the new
MRO, descriptors,metaclasses, etc.) and there is more than a learning
curve issue coming with the added complexity. Davor is right: even if
you do not want to use it, the stuff is *there* and somebody in your
team will. So definitely there is an audience of programmers that just
do not have an use for all the sophistication and actually are
penalized by it.

There is not much than can be done at the Python level. But I would
see with interest a Python spinoff geared towards simplicity. Few
months ago there was the Prothon proposal (by all means a terrible
proposal) but the goal that motivated it (simplification, trying
to remove classes) was in my opinion worthwhile.

Now, *how* to remove (or simplify) classes is not at all clear to me,
not I am convinced that prototypes are the right way to go, but still I
feel that there is something wrong with inheritance. Maybe
protocols are the solution, who knows? But in any case I think it
is important to keep searching for semplicity. I do not believe
Python is the definitive language, and it is probabily possible
to introduce something better. It is just that nothing of the
kind appeared until now, but I keep watching at the horizon ;)
Michele Simionato




More information about the Python-list mailing list