Re: - OOF

From: Charles Esson <charlese_at_cvs.com.au>
Date: Tue, 26 Jan 1999 13:38:17 +1100

I will have a go at at least justifying there use.

Objects are far from a general solution. They have one advantage, they tie the
data and functions together making them ideal for drivers. One address ( the
object address) and you get the lot. Take TYPE as an example.

Yes you could vector type, using say DEFER, yes you could have a table base
address and the table can contain the address of functions to do the work, and
the relevent data, and yes you can do all this using standard forth. But each
effort will be different. OBJECT give you a nice structure to work within.

They are a neat solution to the VALUE problem. What is the VALUE problem you
may ask. The action of TO is dependant on how the VALUE is created. Remember
that the standard defines local variables that are effectively a value as TO
has to work against them. If you make value create an object then the methods
used to access the data go with the value. TO then becomes a word that invokes
methods within the VALUE child.

Yes you can make TO look at something within the VALUE child and work out what
to do. Objects just give a nice general solution.

Objects are not a be all and end end all, they are just another tool. A useful
tool if you want a function to operate against different types of data,
without having to have compile time knowledge of the data type you are going
to deal with.

But as too writing a whole program using objects, to my mind it's in the same
bin as refusing to use them at all.

Charles Esson

talk_at_forth.com wrote:

> Original sender: "Marc Hawley" <marc_hawley_at_email.msn.com>
> Just to try and incite a discussion, I will take the position that "object
> oriented" programming is just a passing fashion; any gains from "reusing"
> object oriented code are more than offset by the overhead of implementing
> and learning this fashion; and effort would be more wisely spent in proper
> factoring and documenting traditional "stack oriented" code.
>
> Anyone care to convince me otherwise?
>
> ...Marc Hawley
>
>

.
Received on Tue Jan 26 1999 - 13:38:17 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.