https://www.folklore.org/Negative_2000_Lines_Of_Code.html
I would definitely agree that early on one writes more lines of code, while later development one spends more time finding where to make a change, and then reviewing the results of the alteration.
Curious how much attention folks pay to this sort of thing --- my current project: https://github.com/WillAdams/gcodepreview is a Literate Program and in its current state just crossed over 1,600 lines of code, but I'm re-working that so that each file will instead be numbered individually.
I personally find some use it in, if nothing else to identify which files probably need to be refactored as they are too large, or complex. Throw in some cyclomatic complexity and you are getting some useful information out the code counts.
Counting lines of code is one metric though. Another I have seen thrown around is ULOC https://cmcenroe.me/2018/12/14/uloc.html where you count the number of unique lines of code,
sort -u *.h *.c | wc -l
Again another metric that potentially speaks to the health of a project. I personally wrote about this some time ago when someone asked why I wrote a code counting project https://boyter.org/posts/why-count-lines-of-code/ and I liked the idea of ULOC so much I integrated it into the project as well.Clearly I am not alone in this though, hence there being so many code counters around (forgive me if I missed yours in the following list) and discussion around it.
- [SLOCCount](https://www.dwheeler.com/sloccount/) the original sloc counter
- [cloc](https://github.com/AlDanial/cloc), inspired by SLOCCount; implemented in Perl for portability
- [gocloc](https://github.com/hhatto/gocloc) a sloc counter in Go inspired by tokei
- [loc](https://github.com/cgag/loc) rust implementation similar to tokei but often faster
- [loccount](https://gitlab.com/esr/loccount) Go implementation written and maintained by ESR
- [ployglot](https://github.com/vmchale/polyglot) ATS sloc counter
- [tokei](https://github.com/XAMPPRocky/tokei) fast, accurate and written in rust
- [sloc](https://github.com/flosse/sloc) coffeescript code counter
- [scc](https://github.com/boyter/scc) my own counter
Incidentally the articles author confused me for a while using standard unix tools to count code, as I had them confused for David Wheeler who wrote the very first code counter that I know of sloccount.This is conventional wisdom, but it still feels dubious.
Often I see additional lines of code added to remove a bug, without adding a bug. So comparing the before and after more lines means less bugs.
On the flip side it often indicates more capability, which is more lines, more bugs, more complexity, but also a very unfair comparison.
I am not completely sure what I am getting at here; but, it seems like there are alot of confounding factors.
The ratio of bugs to lines of code is obviously not constant, but fixing known bugs changes it less than it appears to.
They had imported about a year's worth of crap from a previous repository 2.5 months ago.
I noticed that the loc counter included all commented loc, so I made a legit file of several tens of thousands "loc", checked it in, ran the counter, made the report, was recognized for productivity, and thn reverted the comments.
Productivity, largely, is reducing loc while improving other quality attributes and features...
Especially if more experienced and knowledgeable engineers can remove the code paths that are "in use" but shouldn't be - premature optimizations that can be simplified, redundancies that can be eliminated, features that aren't bringing in value. It's usually an underappreciated job but can lead to greatly improved velocity and significantly less fragility.
It’s generally 50/50, between code (Swift, usually), and comments.
I don’t do the Java “one file for every class” thing, but I still like to keep my files relatively small, if I can.