Why OO? WAS Re: [thelist] php design question

Kelly Hallman khallman at wrack.org
Wed Nov 20 15:09:01 CST 2002


Has anyone mentioned or considered where we would be without a DOM or even
CSS, which are both based largely on the same ideas as objects and classes
that are being discussed?  What would CSS be like if it it didn't
"cascade"?  What the DOM would be like if it was a flat namespace?

Like others, I have been mentally wrestling with the best way to "sell"
the OO paradigm to non-OO programmers.  It occurs to me that many people
have probably run into objects before and either did not understand them,
or did not even know they were objects at all!  Though it's likely most
have benefited from the characterists of objects without even knowing!

The usefulness of OOP to the average web programmer's set of problems is
up for debate, as mentioned numerous times.  However, it seems that the
advantages and usefulness of OOP in general is not really up for
debate...unless you like to debate computer science philosophies like
whether or not a filesystem should have structure!

If you don't see the advantages of OOP, it is probably either because
objects are not fully clear to you yet, or because your programming tasks
are not very complex.  That is not to slight anyone - there is nothing
wrong with either situation.  If objects are not clear yet, don't worry...
it can be very difficult to wrap your mind around the concept at first
(even for seasoned programmers not used to working with objects).
Indeed, I was in a haze of OOP pseudo-understanding for a couple of years!

I wish I had some magic bullet example that would make everyone realize
the benefits of the OO paradigm.  Unfortunately, I don't.  For me, it was
learning python, which is a great language if you want to learn OO or
acquire better coding habits (also a powerful, fun, useful language too).

We probably all started out programming without any structure whatsoever.
Remember when you first figured out neat ways to use an array, or the
advantages of utilizing functions?  Learning OOP is all that and more.

--
Kelly Hallman
http://wrack.org/




More information about the thelist mailing list