home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / eiffel / 1000 next >
Encoding:
Text File  |  1992-07-28  |  1.8 KB  |  59 lines

  1. Newsgroups: comp.lang.eiffel
  2. Path: sparky!uunet!walter!grumpy!bytor
  3. From: bytor@grumpy.bellcore.com (Ross Huitt)
  4. Subject: Re: Small methods ! Why ?
  5. Message-ID: <1992Jul28.145126.18367@walter.bellcore.com>
  6. Sender: bytor@grumpy (Ross Huitt)
  7. Nntp-Posting-Host: grumpy.ctt.bellcore.com
  8. Organization: Bellcore
  9. References:  <13303@ns-mx.uiowa.edu>
  10. Date: Tue, 28 Jul 92 14:51:26 GMT
  11. Lines: 46
  12.  
  13. In article <13303@ns-mx.uiowa.edu>, rajar@herky.cs.uiowa.edu (Chandrashekar Rajaraman) writes:
  14. |> Hi,
  15. |> 
  16. |> I came across the following sentence in a paper:
  17. |> 
  18. |> "Good object oriented programming style seems to encourage the
  19. |> use of many small methods."
  20.  
  21. (Was this from one of my papers? Sounds familiar...)
  22.  
  23. |> 
  24. |> Why is this so ?
  25.  
  26. There are several different reasons. 'get' and 'set'  methods are typically one-liners,
  27. delegation of a message to a component is also a one-liner. These things add up. (Or don't
  28. add up...)
  29.  
  30. |> 
  31. |> This programming style leads to code (and functionality)
  32. |> that is widely dispersed.  Therefore, a maintainer may have to
  33. |> use sophisticated class browsers to understand the code even for
  34. |> a fairly simple task, simply because it is widely dispersed.
  35. |> 
  36. |> This style seems to be quite prevalent among C++
  37. |> programmers.
  38. |> 
  39. |> Is it so with programmers in other OO languages as well ?
  40.  
  41. I have similar numbers for smalltalk as well. I've casually looked at some other
  42. OO languages and they appear to follow the same trend.
  43.  
  44. It appears to be more a function of how OO the code actually is than the language. A system
  45. that is designed and implemented in an OO fashion will (apparently) have far fewer
  46. statements-per-method than a system that is design and implemented using 'conventional'
  47. techniques.
  48.  
  49. |> 
  50. |> Send replies to me.
  51. |> 
  52. |> Thanks.
  53. |> 
  54. |> Chandra
  55.  
  56.  
  57. Ross Huitt
  58. bytor@ctt.bellcore.com
  59.