[Tutor] refactoring book and function size

Anthony Barker abarker@xminc.com
Wed, 18 Sep 2002 00:06:02 -0400 (EDT)


I have been reading the book "Refactoring: Improving the Design of
Existing Code" it makes for a good read - particularly if you have
refactored before on a medium sized project.

One thing I found odd is how they pull out very small bits of code and add
them to new routines.

I am reading "Code Complete", by Steve McConnell in parallel. - he
mentions some research that larger subroutines statistically have fewer
bugs than very small ones. The research shows that routines of up to 200
lines are not bad.

Personally I find readability drops if you have subroutines for less than
2-3 statements. Larger routines, with purpose, clean names and simple
interfaces make understanding a program or module easier.

Anthony
http://xminc.com/anthony/