Re: Mixing OO and DB

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Wed, 26 Mar 2008 09:31:58 -0300
Message-ID: <47ea4242$0$4029$9a566e8b_at_news.aliant.net>


kevin cline wrote:

> On Mar 3, 7:58 pm, Marshall <marshall.spi..._at_gmail.com> 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

Original text of this message