in reply to Re: Questions about sharing code
in thread Questions about sharing code

Thanks dragonchild for the examples. It really helps to see what others are doing.

So, what I'm hearing is: unless what I am doing is specifically OO or needing inheritance, I should just rely on the non-OO-Export method.

Correct?


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Replies are listed 'Best First'.
Re^3: Questions about sharing code
by dragonchild (Archbishop) on Nov 27, 2007 at 18:41 UTC
    Use the right abstraction for the job. OO is a great pattern to work in, but it has a cost associated with it. Use it when necessary.

    Here's another way to look at it - C doesn't have any OO built into the language (leaving aside C++ for the moment). Yet, most stuff is written in C. Yeah, some of it could benefit from OO, but how well would math.h or stdio.h really benefit from it? Those are state-free functions. OO is for tagging state with behavior. If you have no state, then why OO?


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?