I don't think it is so much a matter of short routines mattering more in OO
as it is that short routines make more sense and are more natural. If am
procedural coding and following a rule of thumb that each routine should do
one thing (and do it well), and if a particular one-thing is even
moderately complex then I can easily wind up with 20 line, 40 line, or even 100 line
routines. Iff that code is tightly integrated and really involved in doing
just one thing, then even the 100 line routine flows naturally.
in reply to Short routines matter more in OO?
Some people might find several seemingly logical chunks of that 100 line
routine and pull them into their own routines giving say a 30 line routine
with half a dozen 10-20 line helper routines. This is usually false
complexity reduction. The code is highly integrated, and all we've done
is push the complexity around a smattering of highly coupled routines,
rather than leaving it in a single logical flow (we've probably raised
the overall complexity in our attempt to reduce local complexity). It is
*often* (not always) a mistake to take a nice integrated 100 line routine
and break it into 10 coupled routines (the double meaning of 'break' is
In the OO world we live with highly coupled code all the time. But in OO it
is an organized coupling that guides the design from the beginning, leading
to a multitude of short methods in a class that rely on each other as well
as state. It is not simply a way of collecting and grouping coupled code,
modules (or packages, or libraries, etc) can do that, it is a way of
structuring and organizing the coupling in a manner that relieves the
programmer of having to manage it. Thus, not only are short methods more
natural, very long methods are *often* (not always) indicative of something
amiss in the design.
But all this is but one viewpoint, and simplified for expedience.