home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!emory!ogicse!pdxgate!parsely!percy!data!kend
- From: kend@data.rain.com (Ken Dickey)
- Newsgroups: comp.object
- Subject: Re: objects and closures
- Message-ID: <730@data.rain.com>
- Date: 5 Nov 92 20:11:29 GMT
- Article-I.D.: data.730
- References: <1992Oct27.205320.13271@twg.com> <9210302223.AA11001@cs.columbia.edu> <720756315@sheol.UUCP>
- Organization: Microtek DSD, Hillsboro, OR
- Lines: 34
-
- throopw@sheol.UUCP (Wayne Throop) writes:
-
- >I think that "objects are a poor being's closures" is true in the same
- >sense that "while constructs are a poor being's conditional goto". The
- >closure(goto) is the much more powerful construct when compared to the
- >object(while), but that's not the interesting relationship between the
- >two. The *interesting* relationship is that the essentially-syntactic
- >sucrose making up the object(while) captures an interesting subcase of
- >the closure(goto), which aids software developers in reasoning about a
- >program's behavior.
-
- >So in one sense it is the poor being who *has* the closure(goto), but
- >*lacks* the object(while).
-
- I think that you have the relationship inverted. Having OO only is
- like having WHILE, but not IF, DO, CASE, and GOTO. If you have your
- choice of imperative, OO, functional, etc. styles you have a wider
- range of solutions to choose from in solving a particular problem.
- Yes, you can simulate IF using WHILE, but there are times when IF is
- a more natural solution. OO does not automatically lead to good style
- or "reasonable" programs.
-
- For that matter, one can use (implement) several different object
- models of computation. It is at times fun and convenient to do so.
-
- Some time ago I heard it argued that checking spelling interactively
- was a *bad idea* because it did not fit in well with the Unix pipe
- model (sort | uniq | spell). I think that "OO only and everywhere"
- has similar faults.
-
-
- -Ken Dickey
- P.S. Yes, I have implemented several object systems using closures.
- I have also designed and build a number of industrial software systems.
-