Frankly, I don't believe that every piece of code needs to be An Instance of A Class or Object. Lot's of software requirements just don't lend themselves easily to that sort of abstraction, or at least can function quite well without it, thank you.
So... when do you think it's approppriate to use OO? Do you blend procedural programming with OO?
I know I do. I tend to use objects when there is data of which the internals are not too straightforward, and when I need more instances of them at the same time. For CGI, I wouldn't use OO, except when loading multiple form submissions in the same program at once — which very rarely happens.
For example, for a program I wrote, I have a module that splits formatted text into paragraphs, and paragraphs into lines (= where wordwrap occurs) all in order to determine how much screen layout the text takes. The story (= whole text), paragraphs and lines are objects. That came naturally to me. The rest of the program is mostly the standard procedural stuff.
And you?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: When to use OO
by Aristotle (Chancellor) on Jun 01, 2003 at 12:08 UTC | |
|
Re: When to use OO
by larsen (Parson) on Jun 01, 2003 at 12:08 UTC | |
|
Re: When to use OO
by sauoq (Abbot) on Jun 02, 2003 at 05:39 UTC | |
|
Re: When to use OO
by djantzen (Priest) on Jun 01, 2003 at 21:55 UTC | |
|
Re: When to use OO
by Juerd (Abbot) on Jun 01, 2003 at 12:23 UTC | |
|
Re: When to use OO
by bobdeath (Scribe) on Jun 02, 2003 at 15:14 UTC |