[Tutor] Re: Tutor digest, Vol 1 #1546 - 16 msgs

Jeff Shannon jeff@ccvcorp.com
Thu, 04 Apr 2002 18:35:58 -0800


> Message: 16
> Date: Thu, 4 Apr 2002 19:13:56 -0500
> From: Erik Price <erikprice@mac.com>
> To: tutor@python.org
> Subject: [Tutor] impact of OO
>
> I have a general question about Object Oriented programming in general:
> why is it so lauded by... well, by everyone?
> [...]
> But everywhere I used to read about programming would talk about how OO
> had revolutionized programming.  Now that I know what it is, although I
> really appreciate it and will use it whenever I can (it's so... clean
> compared to what I was doing before), 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.

Actually, you're exactly right -- it really *is* just a different way to organize code.  But when the code that you have numbers not in hundreds of lines, but thousands of lines,
or *hundreds* of thousands of lines, then how you organize it becomes *very* important.  With well-written OO code, you know that you don't need to follow *every* aspect of a
program in order to understand a particular section -- you can focus on only one object, and the objects that it directly interacts with.  It lets you break the code down into
smaller sections that are almost totally self-contained, so that there's less to keep in your head at any one time.  Also, each of those sections is clearer and cleaner, as you've
noticed, so that less effort is required to understand a given amount of code.  And that means that, since you're spending less effort on remembering and understanding the code,
then you have *more* effort available to spend on *improving* the code.  You can also be a lot more confident that your improvements don't strangely affect some totally separate
part of the program, too.

All of these effects add up, and result in better, faster, more stable programs being completed in less time (and therefore lower cost).  Now, add a generous dash of marketing
hype to that, and you'll have the reason why OOP gets so much applause.  ;)

Jeff Shannon
Technician/Programmer
Credit International