Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!gatech!udel!princeton!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.software-eng Subject: Re: WANTED: "C" code line counter program Message-ID: <12609@pucc.Princeton.EDU> Date: 20 Mar 91 16:47:15 GMT References: <1991Mar6.214157.18633@ntpal.uucp> <9082@suns6.crosfield.co.uk> <4816@berry19.UUCP> Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 32 Disclaimer: Author bears full responsibility for contents of this article In article <4816@berry19.UUCP>, crocker@motcid.UUCP (Ronald T. Crocker) writes: > >Get off of this guy's back already. He wants a simple C program to >count C lines of code. Whether LOC is a valid metric is not the >question at hand; LOC is, generally speaking, a good heuristic >measurement of the size of a program. It is not the only one, nor is >it the best. As with any code-based metric, its value can be skewed by >"non-conforming" code; you know, GIGO. Let him worry about ensuring >the validity of the information, just get him a tool to help out >counting lines of code. A metric that counts statements is much better than an inaccurate heuristic and a tool to do so, while not trivial, is easily generated using yacc and lexx. I believe Richard Slomka is the author of a book, "No Nonsense Management", in which he declares that the fact that you cannot obtain perfect numbers does not mean that you should stop searching for better numbers. A crude line counter has negative worth. It will assess programs that use white space to clarify logic as "more complicated" than programs that look like a burst of line noise. I'm not "on the guy's back". But if you're going to measure, do it right. This whole discussion shows why Dijkstra defines software engineering as "computer science for people who can't program." +--------------------------------+ 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