home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / object / 3256 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  14.8 KB

  1. From: kers@hplb.hpl.hp.com (Chris Dollin)
  2. Date: Wed, 19 Aug 1992 10:14:07 GMT
  3. Subject: Re: Re: Type Conformance and Inheritance (was O.M() versus M(O) notation)
  4. Message-ID: <KERS.92Aug19111407@cdollin.hpl.hp.com>
  5. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  6. Path: sparky!uunet!van-bc!rsoft!agate!ames!sun-barr!cs.utexas.edu!sdd.hp.com!hpscdc!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
  7. Newsgroups: comp.object
  8. References: <1992Aug5.162329.22871@ucunix.san.uc.edu> <KERS.92Aug18110434@cdollin.hpl.hp.com> <=!!nmlj.objsys@netcom.com>
  9. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  10. Lines: 307
  11. In-Reply-To: objsys@netcom.com's message of 19 Aug 92 01:09:44 GMT
  12. Nntp-Posting-Host: cdollin.hpl.hp.com
  13.  
  14.  
  15. In some article, objsys@netcom.com (Bob Hathaway) writes:
  16.  
  17. |>I don't see what the grammatical status of an object has to do with anything.
  18. |>Surely we're discussing *meaning*, not *notation*, here, and PGs point is
  19. |>exactly that the asymmetry of the O.M(...) notation *encourages* a
  20. |>corresponding but irrelevant semantic asymmetry.
  21. |
  22. | One, grammar is important since it defines our interface with a programming
  23. | language.  If a natural grammar is used then software engineers (as long
  24. | as they're people) will have an easier time of it; simple ergonomics.
  25. | And grammar is used to hang semantics on and works like a guide to make
  26. | things easier to understand.
  27.  
  28. That's true, but it works in the other direction; you *pick* a grammar to make
  29. the *concepts* clear in the language, rather than picking up some grammar
  30. that's been lying around like a dirty sock and trying to fit it onto your
  31. hands.
  32.  
  33. | And the assymetry is not irrevelevant.  Since an object exists with an
  34. | interface of available operations (and whatever) this is very important.
  35.  
  36. That's if you *assume* that the objects exists with the interface (etc). It's
  37. not a given, it's a choice.
  38.  
  39. |>   is imperative (with an IE,) showing clearly the Object (O) to be the
  40. |>   receiver (or doer) of the command (M) and parameters to be objects.
  41. |>
  42. |>I think it's M that's the "doer" and O,(...) are the parameters.
  43. |
  44. | But this has no bearing on reality, something which we are used to dealing
  45. | with and can naturally solve problems in and can comprehend well.
  46.  
  47. I disagree.
  48.  
  49. In the software reality, M can certainly be the doer; consider CLOS, for
  50. example, with generic functions rather than objects-that-know-how-to.
  51.  
  52. In physical reality, doers are not "sent messages" that tell them how to
  53. change their state. Even the normal (English grammar) notions distinguish the
  54. doer (which performs the action) from the done-to (which suffers it).
  55.  
  56. | We form an "object concept" early on.  The world is made up of objects
  57. | and we are quite good at working with them.
  58.  
  59. See below for my diasgreement.
  60.  
  61. |>   A stack has a push "action" so the stack is the doer of the action and
  62. |>   making this explicit should help.
  63. |>
  64. |>But this is just one interpretation, right? Stacks don't "have" push
  65. |>actions as a matter of Natural Law; it's just one way of carving the
  66. |>computational cake.  We can just as well say that pushes "have" stack
  67. |>variants.
  68. |
  69. |This is jibberish.
  70.  
  71. Thank you for your kind words.
  72.  
  73. | There are stacks in the real world and there are abstract stacks in
  74. | artificial worlds.  They have certain attributes and properties and can
  75. | perform certain operations *by thier very nature*.
  76.  
  77. That's one way of describing the situation, yes. But it's not a matter of
  78. natural law; it's a matter of how you choose to *describe* stacks. Certain
  79. things happen, and certain relationships hold. Attributing control to one or
  80. the other "thing" in the description is a matter of *choice* -- you choose the
  81. description that seems best fitted to your needs.
  82.  
  83. Now, certainly the choice is not *arbitrary* -- it's nice if the description
  84. is internally consistent, nicer if it also describes the kinds of things that
  85. you want it to describe. But that doesn't mean that there's only one choice.
  86.  
  87. | A type can easily capture these properties.
  88.  
  89. Trivially true, as that's what types are *for* -- we wouldn't call them types
  90. if they didn't do that.
  91.  
  92. | This is based on an understanding of the real world, again something we deal
  93. | with quite well and as any object-oriented software engineer can tell you
  94. | has been found to be an excellent (if not the best) way for us to solve
  95. | problems.
  96.  
  97. The real world is a lot bigger than you seem to be implying -- see later.
  98.  
  99. | There is no "push" in the real world, this only exists in our heads
  100. | subjectively and is something quite contrived.
  101.  
  102. Your choice.
  103.  
  104. I've just ``give my cup a little push''. (I was taling to someone about
  105. actions as objects, and how real they were, and this piece of idomatic English
  106. just popped out.) It suggests that actions can be -- are -- objectified in
  107. (some) natural language uses. Are they still not in the real world?
  108.  
  109. | In other words, there aren't little "pushes" floating around but there are
  110. | stacks that one can push an object onto.
  111.  
  112. Your stack is just as much an abstraction as my push. Stacks don't come with
  113. little labels saying "I am a stack" (although I suppose that they would if
  114. they were International Rescue equipment); we call them stacks because they
  115. relate in a particular way to the rest of the world.
  116.  
  117. | It is clearly an operation by nature, it doesn't matter if you call it
  118. | "push" or even if you don't call it anything at all, a stack is still a
  119. | stack and can perform the operation!
  120.  
  121. Oddly enough, the stacks I know of in ``real life'', the archetypal push-down
  122. stack of restaurant trays, are incapable of pushing objects -- something else
  123. has to do the pushing.
  124.  
  125. |>Now, in the case of stacks and pushes, the stack *changes* [assuming we're in
  126. |>an imperative context; in something like Haskell or Axis, the push just gets
  127. |>you a new stack, and nothing changes, not ever, not even a bit.]. You could
  128. |>chose to indetify the "doer" with the thing subject to change ("objects know
  129. |>how to do things to themselves"). An odd model, this, when normally one
  130. |>expects the doer to be the one *not* suffering the effect!
  131. |
  132. | Please read up on the imperative sentence.  Here is a simple example:
  133.  
  134. I am aware of the meaning of ``imperative'' in both the natural-language and
  135. programming-language sense (which is derived from the NL sense).
  136.  
  137. |   Bob, go to the store.
  138. |   Stack, push this tray.
  139. |
  140. | Actually in RWMing:  Bob, put this on the stack.  Stack, push this object.
  141. |
  142. | The doer is clearly defined in the most natural way known to us.  If
  143. | there is no object (entity or whatever) which is to explicitly carry out
  144. | this command, then we could have:
  145.  
  146. Now you are applying the terms of our world model (with intelligent agents
  147. [which, I suspect, is a model we share, irrespective of its truth]) to
  148. software concepts (``objects'') in a way you need to convince me is
  149. well-founded.
  150.  
  151. |   move_element from stack a to stack b
  152. |
  153. | But who carries this out?  The computer?  If we want anything based on
  154. | reality (and I'll be disappointed if I need to supply references) then maybe
  155.  
  156. I don't need any references to reality. I have one here now :-)
  157.  
  158. |   bob, move_element from stack a to stack b.
  159. |
  160. | Or if I'm not around, then maybe:
  161. |
  162. |   stack_mover, move_element from stack a to stack b.
  163. |
  164. |> Also, if several objects (parameters) are affected, this criterion breaks
  165. |> down. What about moving an object from one stack to another? Why should the
  166. |> move "message" be sent to one of them, rather than the other? You may argue
  167. |> that "move" isn't a real primitive on stacks, but who are you to argue with
  168. |> my analysis of a problem domain? [Perhaps I shouldn't call them "stacks",
  169. |> but the point remains.]
  170. |
  171. | I can argue with your analysis on the basis that it has no bearing on
  172. | reality but is rather based on some subjectively contrived system that
  173. | you may prefer, but how do you justify that anyone else will?
  174.  
  175. Reality is more slippery than you seem to think. My analysis would have
  176. ``bearing on reality'' if it let me make (testable) predicictions about
  177. reality that were (by and large) true. (``By and large'' because the world is
  178. far too big for any computer model we build to catch everything. Probably no
  179. model contained *in* the world can model *all* the world.)
  180.  
  181. | And from an SE point of view, there will be others who must understand your
  182. | design. If the design is close to reality, everyone capable of dealing with
  183. | reality will understand it.
  184.  
  185. Of course the design has failed if no-one else has understood it -- but so
  186. what? That's just true about design. It means that designs must be
  187. comprehensible. This is true for OO designs, functional designs, JSP designs,
  188. or Kers's Patented Automagical Analyses.
  189.  
  190. What does ``close to reality'' mean? It means that it employs concepts
  191. familiar to those who work in the real world -- not just *anyone*, of course,
  192. because their are different conceptual breakdowns one can make of the world.
  193. If the design is couched in terms familiar to other designers, then they can
  194. use it.
  195.  
  196. [The if-then in your text is in fact false, unless it's definitional. Let us
  197. take QM and GR as being ``close to reality''. I bloody well don't understand
  198. them. Is that because they're not object-oriented?]
  199.  
  200. | If it is not based on reality, the "object concept" decrees that
  201. | structuring the system into objects is an excellent way of designing systems
  202. | anyway.
  203.  
  204. It's certainly *a* way. It might (or might not) be an *excellent* way. But
  205. it's not the *only* way, and it might not be the only *excellent* way. Decrees
  206. do not establish truth.
  207.  
  208. |>   If this isn't so clear, then go imperative without an explicit receiver of
  209. |>   M.
  210. |>
  211. |>By which I presume mean ``try the symmetic notation''.
  212. |
  213. | Sure.  If all else fails, let the computer do it (the implied imperative
  214. | you)?  This sounds like punting to me.
  215.  
  216. I don't understand what you mean, then. If we're talking about programs ``the
  217. computer'' does *all* [modulo trivia about I/O handling, etc] the doing -- the
  218. "objects" are simulated by the machine. Well, if it can simulate objects, it
  219. can simulate operations, too, and all that describing this as "punting" does
  220. is to say that you don't like it [and cast aspersions on one of Oxfords most
  221. enjoyable activites, to boot].
  222.  
  223. |>   If it is, you're obfuscating the reciever which will be to the detriment
  224. |>    of understanding.
  225. |>
  226. |>Well, the second part follows from the first, because of the meaning of
  227. |>``obfuscation'', but I don't think it's true that one is obf. the receiver,
  228. |>because I think the receiver is the message [at least for the purposes of
  229. |>this note].
  230. |
  231. | As pointed out before, messages as receivers have no bearing on reality,
  232. | do you have a counter example?
  233.  
  234. Perhaps I have mis-spoken; the messages are not the receivers, they are the
  235. doers. You seem to be refusing to take actions as objects; well, that's a
  236. choice. It may be a convenient and frutiful choice; well and good. That
  237. doesn't make it the *only* choice, and I read your arguments as saying
  238. ``object orientation is not only useful, it's *right*''.
  239.  
  240. |>  Also, whats with this "only overloading on the first parameter" stuff?
  241. |>  Have you heard of multi-methods or more simply "dynamic method selection"?
  242. |>
  243. |>Surely this is the point of PGs postings; given multi-methods, why on earth
  244. |>should the invocation syntax specially distinguish one object out of the
  245. |>several supplied?
  246. |
  247. | You're thinking of CLOS, multi-methods are just "dynamic method selection"
  248. | in the context of functions or methods where static and dynamic types are
  249. | present.  Just read Coplien, Advanced C++... for at least one such usage.
  250.  
  251. I *have* read Coplien, thank you. But that doesn't answer the question. I
  252. could just as well say "dynamic method selection" is ``just'' multi-methods.
  253.  
  254. In the presence of multi-methods, why should one argument to a message send
  255. have a special syntactic position?
  256.  
  257. |>   I can't make sense of it.
  258. |>
  259. |>Of multi-methods or of the discussion so far?
  260. |
  261. | Of his use of the expression "overloading on the first parameter".
  262. | Anyone not overloading on all parameters dynamically should be proverbially
  263. | shot.  I am quite knowledgeable on the rest, thank you.
  264.  
  265. Well, "normal" OO languages (Smalltalk, C++, Simula) *do* only ``overload on
  266. the first parameter'' -- that is, the action that is performed is determined
  267. by the "message" and the (type of the) first parameter (the receiver), which
  268. may in consequence be granted special syntactic status.
  269.  
  270. Granted, the selected action may then perform further dispatch, if that's what
  271. the programmer has written. But that's not something the language does *for*
  272. you, whereas in CLOS the action is determined by the "message" (the generic
  273. function) and, in principle,  (the types of) *all* the parameters.
  274.  
  275. So I think that's what PGs expression means.
  276.  
  277. |>Remember, The Real World Is Not Object-Oriented.
  278. |
  279. | Yes it is.  The real world is obviously made up of objects, this statement
  280. | is non sequitur.  Its the function-orientation that has no real-world
  281. | basis, its based soley on artificial formal (and hence extremely weak)
  282. | systems.
  283.  
  284. It's so obvious -- and it isn't true. Yes, it's obvious, and we [humans; I'd
  285. not like to speak for the rest of the biosphere] are probably engineered to
  286. see it that way. It's certainly a handy way to carve up the world, and it
  287. works pretty well.
  288.  
  289. It works *so* well that we try to make things into objects at the least
  290. provocation. Is a classroom an object? How about a university? A nation? A
  291. solar system? A galaxy? A flock of birds? A river? A photon? A traffic jam? An
  292. ozone hole? A county boundary? A code? A (real) window? An (X) window? The
  293. *law* of gravity? The *force* of gravity? Magnetism? The aether? A
  294. (mathematical) group?
  295.  
  296. What sends messages to a mass to tell it to exert force on the floor? What
  297. sends messages to ``1'' in ``1 + 2'' to tell it to compute ``3''? Do I send
  298. messages to my cup when I fill it with tea? Is the object-oriented notion of
  299. "message" appropriate to cups, tea-bags, waves (wet), waves (electo-magnetic),
  300. potentials, colours, warmth, cogitation, dreaming, writing, swimming,
  301. painting, the smell of fresh roses, the Dance of the Sugar-Plum Fairy, Annie
  302. Haslem's voice-without-words at the end of Ashes Are Burning, or the way may
  303. car holds together when at rest? Is Shakespeare's ``Macbeth'' an object? Is
  304. Macbeth (an enactment) an object? Is Macbeth (himself) an object?
  305.  
  306. The world is grossly under-described by the kinds of ``objects'' we seek to
  307. exploit in the object-oriented style of programming. I'll not deny that the
  308. world *has* objects [by which I mean that the concept is enormously useful for
  309. day-to-day living, and allows us to make predications about how the world
  310. will behave]. But they are but *one* way of describing the world, not the
  311. *only* way, and to restrict oneself to that one style is to impoverish
  312. both the world and oneself.
  313.  
  314. Now, in an OO program (or, for that matter, in an OO analysis), one might
  315. *model* some of these things as ``objects''. But that doesn't mean they *are*
  316. objects -- whatever "is" means.
  317. --
  318.  
  319. Regards,    | ``In fingers of trees, and valleys of gold    | Judy Tzuke
  320. Kers.       | I watch as you outshine the charlatan foe.''  | Higher & Higher
  321.