[FoRK] Raise your hand if you rate minimum LOC as an important metric
Stephen D. Williams
sdw at lig.net
Mon Jan 14 19:54:41 PST 2013
On Mon Jan 14 12:08:17 2013, Gregory Alan Bolcer wrote:
> Coding is a language of precision. It sometimes takes a lot to be precise. Condensing things sometimes causes obfuscation and
Of course, but sometimes obfuscation and ambiguity cause obfuscation
> I value readability of code over everything else.
Endlessly readable code is useless and valueless. Once features are
complete, the value of a code base is inversely proportional to its
size and complexity. Porting, reuse, debugging, and all of the ilities
are hampered by excess size. The proper metric is total mental
footprint needed to understand the code at all levels. A completely
clear function is useless if you can't understand the whole system or
easily modify it.
On an outsourced project a couple years ago, the Russian team involved
produced 600+ Java classes in 6 months, averaging <10 lines of code
each, tied together in all kinds of ways, including runtime Maven
scripts, regular expressions operating on XML files put in odd places,
etc. For a client-server backup system with no UI. And they didn't
even implement one of the two core algorithms. Eventually, development
ground to a halt as they couldn't change anything without breaking many
other things. Most classes seemed reasonable, but the result was a
completely obfuscated code base that no one could understand. You
couldn't follow the application flow as at several points only a single
programmer seemed to know how control flowed from one point to another.
They simply refused to refactor as they could never find time in the
face of weekly sprint deliveries.
Hence, I am now far more aggressive about refactoring and conciseness.
Make things as simple as possible, but no simpler. - AI
On several large projects I have ported and rewritten largish code
bases. And I'm doing it again now. Although it is completely
misleading (moved and deleted code), a recent checkin had a git diff of
4.6M lines. This code is only bulky because of many experiments, so
it's nothing like previous projects.
They key point is that properly concise code is more readable then
alternatives. Concise != condensed, compressed, or arcane. It is not
best practices and is clever about factoring out complexity AND bulk.
I developed a number of architecture and design principles for this.
And wrote an outline for a book about it.
> On 1/14/2013 12:04 PM, Stephen Williams wrote:
>> “I didn’t have time to write a short letter, so I’ve written a long one
>> Coding is highly analogous to writing in this way.
More information about the FoRK