Hacker News new | ask | show | jobs
by bronson 3766 days ago
"I no longer think about code lines as an asset to be accumulated, but rather as an expenditure to be avoided."

Good quote. Took me until my 30s before I started realizing this myself. Seems obvious in retrospect.

4 comments

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” -- Bill Gates
I'm only one year out of uni and I figured this too. Lines of code are features and state that will increase the cost of other new features. So adding lines is a cost. The hard part is figuring out what lines of code (features) to add, do them well, and which ones you should not even make.
Obligatory EWD reference:

http://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1036...

...if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger.

2 December 1988

A practice we've implemented to manage this is tagging pull requests that have anything over 250 added (green) lines of code. Before anyone is willing to give you a code review, you have to justify why such a pull request requires so many lines, break it into multiple pull requests, or refactor your code. Often times, it makes review easier because the PR's are smaller and enforces a simple baseline that tells the programmer, your code is too big!
Maybe all diff views should show added lines in red and removed lines in green. If anything, it would help create awareness of the need for more compact systems.