Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!hollie.rdg.dec.com!jch From: jch@hollie.rdg.dec.com (John Haxby) Newsgroups: comp.software-eng Subject: Re: Counting semicolons (was: Re: WANTED: "C" code line counter program) Message-ID: <1991Apr11.160835.15130@hollie.rdg.dec.com> Date: 11 Apr 91 16:08:35 GMT References: <1991Mar15.132757.6883@comm.wang.com> <4196@zaphod.UUCP> <7547@idunno.Princeton.EDU> <1991Mar28.091725.17574@hollie.rdg.dec.com> <12644@pucc.Princeton.EDU> Sender: news@hollie.rdg.dec.com (Mr News) Reply-To: jch@hollie.rdg.dec.com (John Haxby) Organization: Digital Equipment Corporation Lines: 40 In article <12644@pucc.Princeton.EDU>, EGNILGES@pucc.Princeton.EDU (Ed Nilges) writes: |> >There is no absolute metric for counting useful |> >chunks of code (what does useful mean?), it's better |> >to choose a metric and know what the limitations of |> >that metric are than to spend weeks writing some tool |> >(ie a parser) that counts chunks and then falls over |> >in a heap because you have to run it through the C |> >pre-processor first. |> |> Huh? |> |> Run what through the C preprocessor first? I don't think you'd |> want to run the measured code through the PP first because your |> engineers will deal with the unpreprocessed code in nearly all |> cases. You can't parse C without running the source through the PP first--what about people that define things like "BEGIN" and "END" to be "{" and "}" and other less obvius syntactic munging? |> |> Your example of "term" is a good engineer trying to do mathematics |> without having the time to do mathematics. Mathematicians and |> language designers have already cooked up the syntax of C in |> Backus-Naur Form and devising sed/awk tools that ignore this |> work is labor that may seem efficient but which actually wastes |> the work done by the person who first formalized the syntax of |> C. You're right. Actually, an ex-mathematician. C remains, however, difficult to do anything at all with because, as we both pointed out, it doesn't have obviously countable chunks. Better designed or simpler languages have easy to recognize code `chunks'. -- John Haxby, Definitively Wrong. Digital Reading, England <...!ukc!wessex!jch>