From: brett l. <bre...@gm...> - 2011-08-11 20:30:55
|
On Thu, Aug 11, 2011 at 1:02 PM, Erik Vos <eri...@xs...> wrote: >> See below for some stats if you do not believe my words. > > All fine, but so what? Is size bad per se? Class size is a leading indicator of excessive complexity, conflicting goals, unclear design, or just generally difficult to understand code. It's not a hard and fast rule, but it's usually an indicator of "smelly code". [1] [2] In general, a class should have a single, clearly defined responsibility. I think the Hex, MapHex, GUIHex classes do a pretty decent job of staying within their defined sets of responsibilities. It's not perfect, but I think it illustrates the point. Also, I'm not saying that there is a set line count limit for all classes. For example, much of the GUI classes are going to be somewhat lengthy just by virtue of how AWT/Swing is designed. We're just getting to the point in the lifecycle of the project where some of our old design decisions need to be revisited. There's a few of those old decisions that, if we're going to be able to continue moving the project forward, are going to need to be re-decided in light of where we're at now. ---Brett. [1] http://www.codinghorror.com/blog/2006/05/code-smells.html [2] http://www.ibm.com/developerworks/java/library/j-cq06306/index.html |