[Tutor] Follow up to 'class data'

dman dsh8290@rit.edu
Thu, 6 Dec 2001 17:31:53 -0500


On Thu, Dec 06, 2001 at 09:25:12AM -0500, fleet@teachout.org wrote:
 
| Perhaps I asked the wrong question.  If all I want is to use Python for a
| scripting language and some simple programs, is OOP perhaps overkill?

Given that python is as flexible as it is, it is common for a program
to start out small (I think of it as a "script") that uses functions
and maybe even global variables, and fits nicely in a single file.
Usually this gets the job done right now, but it is not as flexible,
customizable, or reusable as possible.  As you continue to use the
program you come up with new features you want to add and ways you
want to customize it (ie giving a path as an argument rather than
hard-coding it).  As the script expands it turns into an "application"
(there is a fine line between the two, though, and it is largely
relative) and can benefit from OOP.  Python make the conversion from
using a procedural style to OOP rather easy (compared to some other
languages).

My view is : make the program as simple as possible, but no simpler.
Don't use OOP if your program would be trivial without it.  If you
need to expand it later, you can make the transition then.  (but by
all means, go ahead and learn OOP principles so you can apply them
when appropriate)

-D 

-- 

If we confess our sins, He is faithful and just and will forgive us our
sins and purify us from all unrighteousness.
        I John 1:9