http://qs321.pair.com?node_id=76193


in reply to Line-counts of perl programs/modules

Line counts are something that bean counters that do not understand software or rather quality software, use as a metric to determine how efficient their programmers are. I could quite easily pump out 1000 lines of crap code per day, and then have to change half of them 3 times and remove 30% to get to a predetermined level of quality, or I can average 1/4 of that, and produce code that has the requested level of quality from the start. Depending on the size of the project I may not code anything for days or weeks, while working through the design. Frequently the well thought out design has fewer lines of code and also has a higher level of quality (fewer lines of code usually means fewer chances to make a mistake).

However, to really answer your question, if some bean counter does ask for such a metric, I usually just give them a wc -l, or possibly, if I'm trying to make them think I've put some real work into the number, I have a script that does a glorified wc -l, but has an impressive name, and a hideous number of comand line switches and 'thinks' about the result for about 45 seconds to a minute, and then prints its result.

  • Comment on Re: Line-counts of perl programs/modules

Replies are listed 'Best First'.
Re: Re: Line-counts of perl programs/modules
by indigo (Scribe) on Apr 28, 2001 at 00:18 UTC
    Back in my C days, we had a manager who was obsessed with line counts. Not just the data, but he wanted to make sure those lazy programmers weren't inflating their line count by including whitespace, comments, wrapped lines, or anything like that. He eventually came up with a byzantine set of rules he expected us to follow.

    In the end, we started running code through the preprocessor before we delivered.

    Moral: If you impose arbitrary metrics, programmers will do arbitrary things to reach those metrics.