Re: Source lines of code (SLOC) -- meaningful number?
by dbwiz (Curate) on Jun 08, 2005 at 14:31 UTC
|
| [reply] |
|
| [reply] |
Re: Source lines of code (SLOC) -- meaningful number?
by BrowserUk (Patriarch) on Jun 08, 2005 at 15:41 UTC
|
| [reply] |
Re: Source lines of code (SLOC) -- meaningful number?
by hv (Prior) on Jun 08, 2005 at 16:09 UTC
|
The largest application I've written was around 200 KLOC, but that was in 6800-assembler, one instruction per line. My current work application suite consists of around 34K lines of perl code, and is much more complex.
I'd say LOC can be mildly useful as a very approximate measure of the complexity of an application, but that it is very dependent on the language and on an individual programmer's style.
As a measure of productivity I'd rate it completely useless - my most productive days are the ones where I reduce the number of lines, while retaining or improving the functionality.
Hugo
| [reply] |
|
Many SLOC "propaganda" resources claim that it doesn't matter what language you write in, the same amount of lines takes approximately the same amount of time. Having written large applications in both assembler and Perl, do you think this is true?
| [reply] |
|
No.
First pass at the code tends to take time according to the number of function points. A line of perl code that I fully understand before I write it takes the same amount of time to think about as the 30 to 40 lines of assembler code it is equivalent to, with which I'm equally familiar. Typing the assembler code takes a bit longer, but they're pretty short lines and keyboard-memory takes over, so back when I was writing the assembler it would probably take me only 5 times as long to write the 30-40 lines of code as it does now to write 1 line of perl code.
Other features can also have a massive effect - when I started writing that assembler application, the assembler itself was hardwired to print out a full listing and concordance, and for the application I was dealing with that took about 7 hours. Since at that point we were just starting to get hold of hard disks, modifying the assembler to spool the listing to disk reduced the turnaround to around 5 minutes, which had a massive effect on how you could go about writing and debugging programs.
Similarly, how long it takes to find and fix a bug is in my experience much less dependent on LOC or language, and much more on the problem domain and the tools and techniques available - only the passage of time allows me to look back without shuddering at a stack corruption bug I once had in a keyboard interrupt handler, which took over a month of full time work to resolve.
Hugo
| [reply] |
|
Re: Source lines of code (SLOC) -- meaningful number?
by rinceWind (Monsignor) on Jun 09, 2005 at 09:20 UTC
|
See my node Yet another code counter for something that will count lines and handle comments. It also produces a count of 'tokens'.
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ? (Missquoting Janis Joplin)
| [reply] |
Re: Source lines of code (SLOC) -- meaningful number?
by wazoox (Prior) on Jun 09, 2005 at 11:14 UTC
|
I actually monitor the SLOC count of my various projects, and I find it a good enough tool to approximate the job done. Keep in mind SLOCcount suppose the analysed code to be complete and debugged; it usually isn't that bad as an evaluation (but it can't check for large copy-and-paste in different files). | [reply] |
Re: Source lines of code (SLOC) -- meaningful number?
by samtregar (Abbot) on Jun 09, 2005 at 17:43 UTC
|
| [reply] |
|
| [reply] |
|
POD, whitespace and comments. RTFM for more details.
-sam
| [reply] |
Re: Source lines of code (SLOC) -- meaningful number?
by TedPride (Priest) on Jun 08, 2005 at 18:16 UTC
|
A line of code in Perl is much more powerful than a line of code in any other language I know. Since it's more powerful, it also generally takes a little longer to write, and not as many total lines of code are needed.
Short version - SLOC is pointless when comparing Perl to other programming languages. SLOC is probably not even that useful when comparing Perl code written by different programmers. | [reply] |
|
| [reply] |