in reply to Counting lines of C code
The simplest, most naive way to do this is wc -l or the equivalent in Perl, which would look something like
#!/usr/bin/perl my $lc = 0; while ( <> ) { $lc++ } print "$lc\n";
The meta problem depends on what you're going to use the LOC count for. If you're trying to draw a parallel between actual code and lines of text for some purpose that will eventually involve rating coders, you're in for a lot of trouble. People quickly figure out how to generate lots of lines of stuff when they're being graded on it. Simple ways of counting can lead to stupid behavior.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: LOC
by Chmrr (Vicar) on Jul 25, 2002 at 19:49 UTC | |
by jsprat (Curate) on Jul 25, 2002 at 20:13 UTC | |
by Chmrr (Vicar) on Jul 25, 2002 at 20:28 UTC |