Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!princeton!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.software-eng Subject: Re: WANTED: "C" code line counter program Message-ID: <12646@pucc.Princeton.EDU> Date: 30 Mar 91 02:33:51 GMT References: <1991Mar6.214157.18633@ntpal.uucp# <9082@suns6.crosfield.co.uk# <12630@pucc.Princeton.EDU> <1991Mar28.145235.14313@grep.co.uk> Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 38 Disclaimer: Author bears full responsibility for contents of this article In article <1991Mar28.145235.14313@grep.co.uk>, frank@grep.co.uk (Frank Wales) writes: > >Cases like this (fictitious or not) seem to me to highlight >the problems of metrics like "lines of code" or "statement >counts", because these are predicated on the notion that statements >or lines are uniformly complex, fundamental pieces from which >programs are built. It's hard for me to accept such a notion >for anything other than assembly language. Even if you counted lexemes (these are the things that the "lexi- cal analyzer" recognizes, including identifiers, constants, operators and so on), you'd not measure complexity fully. There are two reasons for this: one psychological and one mathematical. The psychological reason? Different lexemes have different instrinsic complexity, considering complexity as a property of our minds. The "+" sign is less complex, perhaps, than the "-" sign. The trouble with this is that psychological measurements typically ignore enormous individual differences in perception of complexity. Niklaus Wirth has pointed out that whenever you add two positive numbers (a seemingly simple operation) you are in danger of overflow: does this mean that addition of two positive integers is more complex than subtraction two positive integers where neither overflow nor underflow can occur (0-(2**31-1) in twos-complement is the worst case)? The mathematical reason? The total number of lexemes increases complexity, but so does the ways in which those lexemes are COMBINED. The structured statement a+b is simply a more complex artifact than the unordered, unstructured SET of lexemes {a,b,+}. Both have the "metric" 3. +--------------------------------+ Edward G. Nilges | Child support, tax-deductible | Princeton University | to payer AND receiver: an idea | Information Center | whose time has come. | Bitnet: EGNILGES@PUCC +--------------------------------+ (609) 258-2985