[Tutor] impact of OO
alan.gauld@bt.com
alan.gauld@bt.com
Fri, 5 Apr 2002 11:19:16 +0100
> I have a general question about Object Oriented programming
> in general: why is it so lauded by... well, by everyone?
Its not. There are several minority groups who believe that
OO is a retrograde step. Others believe that things like
Functional Programming are more important etc etc. But
the general opinion is that OO is a big improvement on
traditional "Structured Methods"
There are lots of reasons, most only relevant to large
projects so its hard for the newbie writing programs of
only a few hundred lines to see the avantages. But one
your prohgrams get into the tens of thousands of lines
the benefits become far more obvious. However...
> to with a group of variable names. It's hard to describe, but this
> makes it much easier --
... even in smaller projects it can show benefits in ease
of comprehension - as you've seen.
> but it is far more organized and cleaner.
We used to have one maintenance programmer looking after,
on average 20,000 lines of code(in C) when we moved to
OO designs we have one programmer looking after 100,000
lines. A 5 to 1 improvement, mainly due to the better
cohesion of the designs using OOP.
> ...but I still don't really see how
> it's that big a deal -- it's simply a different way of
> organizing code, as far as I can tell.
Which is the hardest aspect of industrial grade
software engineering. Organizing code such that when one
bit changes you don't need to change everything elsder
with it has been the biggest headache in softwae since
the start of commercial programming. OOP helps do just that.
> Please prove me wrong and help me see how OO "changed everything".
It doesn't change everything but it helps a lot.
There are other aspects to OOP too that we haven't
touched on. The ease of extending existing code without
changing it (and thus breaking existing code relying
on the bit being extended) via inheritance. The way
OOP eliminates long if/elif/else chains (or switch
statements)via polymorphism (see the OOP page in my
tutor for a discussion of polymorphism and inheritance)
The ability to build whoile abstract frameworks which
act as application templates. These can quickly be
added to to produce new apps - most GUI frameworks
are done this way.
> PS: Also, I have heard someone say that "in Java everything is an
> object".
Its a lie. In Java everything is in a class...
only some things are objects. There is a big difference
which the Java community seems to disregard. But claiming
that everything is anobject is a big marketing coup!
> Java, especially since there are many employers
This sadly is true. Mainly a result of the "emperors new clothes" syndrome
but none the less Java is taking over.
in my area (Boston)
> advertising an interest in Java programmers (and I will be
> out of a job
> as soon as my project is finished). Sadly, much more than Python or
> PHP. But it seems like a big language to learn.
>
>
>
>
>
>