From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3B621BC8B for ; Sat, 12 Feb 2005 19:44:36 +0100 (CET) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1CIiYr2032256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 12 Feb 2005 19:44:35 +0100 Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.13.1/8.13.1) with ESMTP id j1CIiEg6028147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Feb 2005 12:44:18 -0600 (CST) Date: Sat, 12 Feb 2005 12:47:54 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Thomas Fischbacher Cc: Michael Walter , skaller , Jon , Subject: Re: [Caml-list] The boon of static type checking In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 420E4E92.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 wrote:01 compilers:01 kloc:01 innate:98 1,000:98 1,000:98 1.5:98 centuries:98 integer:01 interactions:01 interactions:01 checking:01 linear:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Sat, 12 Feb 2005, Thomas Fischbacher wrote: > > On Sat, 12 Feb 2005, Brian Hurt wrote: > > > And I disbeleive the "makes it easier with large programs" statement. > > It's contrary to all evidence I've seen, and all my experience. The > > complexity of a program is, I've postulated, a function of the number of > > interactions between different parts of the code. And that therefor the > > innate complexity approximately scales with the square of the number of > > lines of code- so a 10,000 line program is 100 times as complicated as a > > 1,000 line program. Brooks has evidence of this as well. > > I don't think this is true. It certainly is for spaghetti code, but isn't > it just the essence of structured programming to avoid having complexity > scale like (lines)^2? Structured programming just has a different constant factor. Also, what sort of programming you're doing also changes the constant factors. Brooks himself noticed this- that compilers seemed to be about 3 times as difficult per LOC as normal programs, and operating systems about 3 times more difficult still. Not sure if this still holds. > > There are both quite general and strong reasons why one > should expect the complexity of programs of roughly the same "style" > (whatever one has to invent to make a proper, meaningful notion out of > this) to obey a scaling law of the form > > [nontrivial interactions] ~ [lines]^N > > but not necessarily with an integer exponent. I furthermore strongly > suppose that this exponent should depend a lot on the programmer. Obviously N > 1. I'd also argue that N <= 2. But I think N is closer to 2 than to 1, i.e. N > 1.5. Assume 1,000 lines = 1 day of work (I generally toss off a thousand line program in a day)- how long does a 10,000 line program take? With N=2, the 10KLOC program takes about 100 days, or 5 man-months. You're right, that's long. With N=1.5, it takes ~31 days, or 6 weeks. This is closer. With N=1.75, it takes ~56 days (11 weeks). Assuming 5 days/week and 20 days/month. So, you're right- an N in the range of 1.5-1.75 sounds about right. Note that with N=1.5, a 100,000 program takes 1,000 man-days, or 50 man-months (4 man-years), and a 1,000,000 line program takes man centuries. The important point is the scaling is exponential, not linear. Brian