Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!seal.cis.ohio-state.edu!ogden From: ogden@seal.cis.ohio-state.edu (William F Ogden) Newsgroups: comp.lang.eiffel Subject: Re: Reference Semantics Message-ID: <133611@tut.cis.ohio-state.edu> Date: 12 Jun 91 18:59:12 GMT References: <1991Jun10.215822.28034@m.cs.uiuc.edu> <133169@tut.cis.ohio-state.edu> <1991Jun11.223305.16439@m.cs.uiuc.edu> Sender: news@tut.cis.ohio-state.edu Organization: The Ohio State University, Department of Computer and Information Science Lines: 57 In article <1991Jun11.223305.16439@m.cs.uiuc.edu> johnson@cs.uiuc.EDU (Ralph Johnson) writes: |>>Improper use of references can certainly cause problems, but |>>improper use of anything can cause problems. |> Improper use of GoTo's can certainly cause problems also, but we don't |> use them much any more. We observed that there was a problem and that |> there were efficient alternatives, and we changed our ways. >Bill, this is an annoying message. I carefully stated that reference >semantics were often the RIGHT way to think about a problem and to >specify it. You seem to have completely ignored the whole point of >my message, so why bother to quote it? My intent was certainly not to annoy but rather (in the Socratic tradition of such dialogues on these newsgroups) to try to make a point as clearly as possible. The point was that what is initially considered to be a relatively minor negative feature of a solution mechanism can prove to be its undoing. >Perhaps C pointers are like go-tos, but object references are not. C pointers are surely a more `interesting' mechanism, perhaps engendering a level of excitement in programming more comparable to that produced by the jump instruction in assembly languages. Be that as it may, it still seems that an object which is the target of multiple references is completely analogous to a label which is the target of multiple GoTo's. >If you want to model a world with state then object references make >programs clearer and easier to understand. In my opinion, the inventions >of the functional programming language community to compensate are >confusing and are unlikely to make programs easier to understand. I sense that a _false alternative_ may be intruding into the discussion here. The options are not either an object oriented approach with multi- reference semantics or a pure functional language approach; there is a whole spectrum of other possibilities. >If you don't have references in your language then you will be forced >to simulate them. I don't think anyone would propose banning references at this stage in history. The issue was whether their routine use should be encouraged. > Consider a user interface system. It is natural to ... [Sketch deleted] Sounds interesting. Could you elaborate a simple example in sufficient detail to make it clear what the basis for the claim that references are essential for a well encapsulated design is. (Email would be fine, if the smallest examples are too messy for viewing by a general audience.) -- /Bill