On Tue, Jan 25, 2011 at 3:26 PM, Elwin Estle <chrysalis_reb...@yahoo.com> wrote: > > Is it better to have one large sort of "do it all" class, or break the larger > class up into smaller classes? Seems to me like the one large class would be > clearer in some ways. I have something I am trying to do that have somewhere > in the neighborhood of 20 attributes that all relate together, however there > are sort of "clumps" of attributes that have a sub-relationship to each other > and I wondered if they should be their own class, but I am not sure, assuming > that is a good idea, how these smaller classes might work together. I have > only the foggiest notion of inheritance and I'd kind of like to stay away > from that aspect of things until I get a better grasp of individual classes. >
For me, the question of one big class/multiple smaller classes comes down to reusability. If you find yourself writing the same code over and over again (or cutting/pasting big blocks of code), you should probably break up your classes. -- www.fsrtechnologies.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor