Re: Mixing OO and DB
Date: Wed, 26 Mar 2008 09:31:58 -0300
kevin cline wrote:
>>On Mar 3, 5:39 pm, Robert Martin <uncle..._at_objectmentor.com> wrote:
>>I recall an actual empirical study that looked at defects per line >>of code relative to function size. The rate stayed constant until >>function size exceeded 150-200 lines.
> Ok. But I still argue that programs with many short functions will
> have fewer defects, because they will be shorter.
Each function will be shorter, but the probability increases that one might call the wrong function at some point. One can reach a point of diminishing returns.
When I first
> adopted the 'short function' style, I was amazed to discover how often
> those little functions end up being reused. I expect that if you hand
> me any program where the average function size is more than about 20
> lines, I would be able to refactor that program into short functions
> and reduce the line count by half or more.
As I recall from research done more than 20 years ago, the highest bug correlation is unused variables. Received on Wed Mar 26 2008 - 13:31:58 CET