[comp.misc] WANTED: "C" code line counter program

torek@elf.ee.lbl.gov (Chris Torek) (03/19/91)

Although these observations have been made before, I will make them
again.

Code `productivity' metrics are hard to define, but line counts are
not even a good approximation.

>Once you have the comments removed, you can use the wc program ...

If you remove comments, such a line count would call a day wasted if
it were spent commenting some code so that it could be maintained.

Whether or not you remove comments, deleting lines is not necessarily
`negative productivity'.  For instance, in order to make TCP work over
actual (lossy) networks, you need good estimates of the round trip time
and its variance.  Van Jacobson did this for Berkeley Unix; when he was
done, the final code was several lines shorter, but it was much faster
over real Internet connections.  He has recently removed even more
lines (and added just a few in a few critical places) and obtained
large performance improvements.

What is really needed is a way to measure the amount of `useful thought'
put in, rather than the number of characters typed.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov

dww@math.fu-berlin.de (Debora Weber-Wulff) (03/20/91)

torek@elf.ee.lbl.gov (Chris Torek) writes:




>Code `productivity' metrics are hard to define, but line counts are
>not even a good approximation.

I feel the same way about lines of code, BUT... 
After spending about 3 years trying to convince management that
LOC is a stupid metric when you are using DBMS and program
generators and stuff, we sat down one afternoon and counted all
the blasted lines written and generated (including comments,
they are the most valuable code!), added up the number of
person-days (more or less 5 persons) on the project and came up with 
(GULP!) ~20 LOC/person/day. This was the number management
wanted to see, it made their day when we were able to give
them their little number. So it goes.




















-- 
Debora Weber-Wulff
snail: FU Berlin, ZI Fachdidaktiken, Habelschwerdter Allee 45, W-1000 Berlin 33
email: weberwu@inf.fu-berlin.de, dww@math.fu-berlin.de

chip@tct.uucp (Chip Salzenberg) (03/25/91)

According to dww@math.fu-berlin.de (Debora Weber-Wulff):
>(GULP!) ~20 LOC/person/day. This was the number management
>wanted to see, it made their day when we were able to give
>them their little number. So it goes.

Management education is a part of a real programmer's job.

If you hand them a meaningless number, you do them and yourself a
disservice -- even if they think they want it.
-- 
Chip Salzenberg at Teltronics/TCT     <chip@tct.uucp>, <uunet!pdn!tct!chip>
   "All this is conjecture of course, since I *only* post in the nude.
    Nothing comes between me and my t.b.  Nothing."   -- Bill Coderre

decot@hpisod2.cup.hp.com (Dave Decot) (03/26/91)

> >(GULP!) ~20 LOC/person/day. This was the number management
> >wanted to see, it made their day when we were able to give
> >them their little number. So it goes.
> 
> Management education is a part of a real programmer's job.
> 
> If you hand them a meaningless number, you do them and yourself a
> disservice -- even if they think they want it.

Ah, but they insist upon it, admitting all the while that it is indeed
meaningless but "better than nothing", and besides "my boss requires it".

Dave