Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: The OO appr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 24 of 36 Topic 3978 of 4160
Post > Topic >>

Re: The OO approach

by Doug Hoffman <no.spam> Mar 29, 2008 at 08:57 AM

Jonah Thomas wrote:
> I've consistently avoided OO. I've tried to avoid problems that are
> complicated enough for OO to be valuable.

That's similar to trying to avoid using create/does>.  Yes, there is 
some extra complexity.  But in some, not all, problems it is very 
worthwhile.

-snip-

> OO is a mature technology that's mostly failed. The promise was that it
> would work. The reality is that it can be made to work with a lot of
> inspired hard work, but by default it doesn't particularly get results.

No.  Think of OOP as create/does> on steroids.  For example:

\ **First let's use create/does>

0 constant to>
1 constant from>

\ assumes 4 byte cell
: CDobject \ create/does> object factory
	create  4 allot
	does>
	>r
	IF ( from>) r> @[EMAIL PROTECTED]
 ELSE ( to>) r> ! THEN ;


CDobject x
  ok

45 to> x
  ok

from> x .
45  ok


\ **Now let's use objects

:class OOobject \ OO object factory
	4 bytes data

  :m to: ( n -- ) self ! ;m
  :m from: ( -- n) self @[EMAIL PROTECTED]
 ;m

;class


OOobject y
  ok

45 to: y
  ok

from: y .
45  ok

Of course with objects we can do a lot more than create/does>.  I won't 
not go into all of that here.

Has create/does> failed?  I don't think so.

What if someone had hyped create/does> as the "Magic Silver Bullet" that 
would solve all of your programming problems?  You and I both know that 
is not true.  But does that mean create/does> has no value and we should 
now abandon it?  I don't think so.

Same thing for OOP.  It may well have been overly hyped.  But if so, 
that should have no bearing on a decision to use it today.  For some 
problems it is *very* useful.  For other problems not.

I think that if any "over hyping" of OOP has occurred it was because 
suddenly it gave users of languages other than Forth the power of a 
create/does> construct.  I can see where people using other languages 
would become excited over suddenly having the power (and more) of 
Forth's create/does>.

But again, create/does> is quite limited in what it can do compared to a 
proper object programming extension.  So I believe that in Forth there 
is a place for both create/does> and OOP.

-Doug

> We're probably ripe for something new. Something that claims to fulfill
> the promises that OO made and failed at.




> People won't agree to go back
> to the bad old days before they had OO, when there was no way to get a
> good result except hard work and inspired improvisation. They'll want
> something new that looks even better.
> 
> I'd like to predict what the new thing will be like. It has to explain
> why OO has failed. It must promise to succeed at those things and more.
> Do you have links to the clearest explanations about OO's promises? What
> was it exactly that project managers needed and didn't have, that they
> hoped OO would give them?
 




 36 Posts in Topic:
The OO approach
Jonah Thomas <jethomas  2008-03-27 18:11:17 
Re: The OO approach
Bruce McFarling <agila  2008-03-27 18:58:22 
Re: The OO approach
John Passaniti <nntp@[  2008-03-28 21:10:34 
Re: The OO approach
Bruce McFarling <agila  2008-03-28 22:50:39 
Re: The OO approach
John Passaniti <put-my  2008-03-29 15:17:29 
Re: The OO approach
kenney@[EMAIL PROTECTED]   2008-03-30 10:56:21 
Re: The OO approach
Bruce McFarling <agila  2008-03-29 17:09:06 
Re: The OO approach
kenney@[EMAIL PROTECTED]   2008-03-30 10:56:21 
Re: The OO approach
Bruce McFarling <agila  2008-03-30 10:13:54 
Re: The OO approach
John Passaniti <john.p  2008-03-27 23:14:16 
Re: The OO approach
Gerry <gerry@[EMAIL PR  2008-03-28 03:40:23 
Re: The OO approach
Albert van der Horst <  2008-03-28 10:59:05 
Re: The OO approach
John Passaniti <nntp@[  2008-03-28 16:30:25 
Re: The OO approach
Bruce McFarling <agila  2008-03-28 08:40:42 
Re: The OO approach
"Jenny Brien" &  2008-03-28 17:44:14 
Re: The OO approach
Bruce McFarling <agila  2008-03-28 09:02:15 
Re: The OO approach
Bruce McFarling <agila  2008-03-28 11:08:40 
Re: The OO approach
William James <w_a_x_m  2008-03-29 14:30:10 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-28 07:11:12 
Re: The OO approach
Bernd Paysan <bernd.pa  2008-03-28 14:18:04 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-28 08:32:11 
Re: The OO approach
John Passaniti <nntp@[  2008-03-28 20:57:19 
Re: The OO approach
Helmar <helmwo@[EMAIL   2008-03-28 12:48:52 
Re: The OO approach
Doug Hoffman <no.spam&  2008-03-29 08:57:02 
Re: The OO approach
Bruce McFarling <agila  2008-03-29 09:41:35 
Re: The OO approach
Bruce McFarling <agila  2008-03-29 09:56:23 
Re: The OO approach
Bruce McFarling <agila  2008-03-29 10:44:15 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-29 12:08:22 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-29 12:39:02 
Re: The OO approach
Elizabeth D Rather <er  2008-03-29 07:30:55 
Re: The OO approach
Bruce McFarling <agila  2008-03-29 10:54:20 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-29 13:34:25 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-29 22:33:31 
Re: The OO approach
John Passaniti <nntp@[  2008-03-30 06:09:07 
Re: The OO approach
Andrew Haley <andrew29  2008-03-30 10:06:31 
Re: The OO approach
Jonah Thomas <jethomas  2008-03-30 08:39:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 18 20:41:26 CDT 2008.