[Tutor] refactoring book and function size
Erik Price
erikprice@mac.com
Wed, 18 Sep 2002 10:44:12 -0400
On Wednesday, September 18, 2002, at 10:29 AM, Magnus Lycka wrote:
> On one hand, it makes each method trivial, but on the other
> hand, it might lead to a situation where you are a bit lost
> with all these methods. In Python there is also the time
> involved in function call overhead to consider.
I have often wondered about this. Are classes considered "bloated" if
they feature a ton of methods to do various things with the data
contained within the object? If so, is that true even if it wouldn't
make sense to move some of these methods to a separate class (say,
these methods are inherent behaviors that would seem best to go with
the original object)?
I find it easier to have a single method that does what I need than to
have four methods that can be combined to do what I need (unless of
course I ever have need for one of those four methods individually).
It's less information about the class's interface that I need to
remember. But that might not be the best approach to be taking.
Erik
--
Erik Price (zombies roam)
email: erikprice@mac.com
jabber: erikprice@jabber.org