[NCLUG] programming question

mike cullerton michaelc at cullerton.com
Sun Jul 1 08:45:26 MDT 2001


thanks charles, (as usual) this was very helpful.

on 6/30/01 6:51 PM, Charles Clarke at clarke at clarkecomputer.com wrote:

> On Sat, 30 Jun 2001, mike cullerton wrote:
> 
>> this is a theoretical question. i'm wondering, is there a difference, in
>> general, programmatically speaking, between having one large object, two
>> disjoint objects or an object that extends another object.
> 
> Yes.  What it is exactly depends on the programming language.
> 
> Normally, one large object will take reasonable memory and be faster
> executing.  It may be harder to understand or reuse though.
> 
> Two disjoint objects can lead to problems later if you need to modify some
> of the common code.  Bad for reuse.  Will take less space for the smaller
> object of the two.  Executes as fast(possibly faster) than one large.
> 
> One object extending the other will generally use more space, though with
> a smart language it won't.  It will also generally use more time
> (dereferencing to find the base class; the extra space is used by the
> pointers), but again, with a smart language, it won't.  It is much easier
> to understand conceptually though and is the way I would recommend you
> code unless you have a strong reason (unacceptable performance, etc.) to
> do otherwise. 
> 
> charles
> 

 -- mike cullerton





More information about the NCLUG mailing list