home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.eiffel
- Path: sparky!uunet!walter!grumpy!bytor
- From: bytor@grumpy.bellcore.com (Ross Huitt)
- Subject: Re: Small methods ! Why ?
- Message-ID: <1992Jul28.145126.18367@walter.bellcore.com>
- Sender: bytor@grumpy (Ross Huitt)
- Nntp-Posting-Host: grumpy.ctt.bellcore.com
- Organization: Bellcore
- References: <13303@ns-mx.uiowa.edu>
- Date: Tue, 28 Jul 92 14:51:26 GMT
- Lines: 46
-
- In article <13303@ns-mx.uiowa.edu>, rajar@herky.cs.uiowa.edu (Chandrashekar Rajaraman) writes:
- |> Hi,
- |>
- |> I came across the following sentence in a paper:
- |>
- |> "Good object oriented programming style seems to encourage the
- |> use of many small methods."
-
- (Was this from one of my papers? Sounds familiar...)
-
- |>
- |> Why is this so ?
-
- There are several different reasons. 'get' and 'set' methods are typically one-liners,
- delegation of a message to a component is also a one-liner. These things add up. (Or don't
- add up...)
-
- |>
- |> This programming style leads to code (and functionality)
- |> that is widely dispersed. Therefore, a maintainer may have to
- |> use sophisticated class browsers to understand the code even for
- |> a fairly simple task, simply because it is widely dispersed.
- |>
- |> This style seems to be quite prevalent among C++
- |> programmers.
- |>
- |> Is it so with programmers in other OO languages as well ?
-
- I have similar numbers for smalltalk as well. I've casually looked at some other
- OO languages and they appear to follow the same trend.
-
- It appears to be more a function of how OO the code actually is than the language. A system
- that is designed and implemented in an OO fashion will (apparently) have far fewer
- statements-per-method than a system that is design and implemented using 'conventional'
- techniques.
-
- |>
- |> Send replies to me.
- |>
- |> Thanks.
- |>
- |> Chandra
-
-
- Ross Huitt
- bytor@ctt.bellcore.com
-