note
eyepopslikeamosquito
<P>
<blockquote>
<P>
<I>
Maintainability is the nebulous measurement of how easy it is to understand and modify a program.
Write some code. Come back to it in six months (or six days).
How long does it take you to find and fix a bug or add a feature?
That's maintainability.
</I>
</P>
<P>
<I>
Maintainability doesn't measure whether you have to look up the syntax for a builtin or a library function.
It doesn't measure how someone who has never programmed before will or won't read your code.
Assume you're talking to a competent programmer who understands the problem you're trying to solve.
How much work does she have to put in to understand your code? What problems will she face in doing so?
</I>
</P>
<P align="right">
<small>-- [chromatic] in <a href="http://modernperlbooks.com">Modern Perl</a> ("Style and Efficacy" section)</small>
</P>
</blockquote>
</P>
<P>
Oh, one more thing.
Don't fall for the old chestnut that <I>"Python is more readable than Perl"</I>.
Or that <I>"Perl looks like line noise"</I>.
Instead, remind anyone who makes such a claim that Russian is "unreadable" if you don't know Russian.
Then further challenge them to explain how Python's magical powers of readability ensures that they:
<ul>
<li> Make sound domain abstractions.
<li> Decompose their programs wisely into highly cohesive, loosely coupled modules.
<li> Choose descriptive, explanatory, consistent and regular names.
<li> Write useful comments.
<li> Minimize the exposure of implementation details.
<li> Avoid duplication (<a href="https://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a>).
<li> Don't use magic numbers in their code.
<li> Create interfaces that are: consistent; easy to use correctly; hard to use incorrectly; easy to read, maintain and extend; clearly documented; appropriate to audience.
<li> Write components that are testable in isolation.
<li> Establish a rational error handling policy and follow it strictly.
</ul>
</P>
<P>
That is, "readability" is far less important than "maintainability" --
so that programmers who know the language can come
to the code later in its life and
understand its construction and intentions
and change it comfortably and confidently.
And writing "maintainable" Perl is just as easy as writing "maintainable" Python.
</P>
<P>
Update: <a href="https://en.wikipedia.org/wiki/Computer_programming">Computer programming (wikipedia)</a>
defines <I>Readability</I> as "the ease with which a human reader can comprehend the purpose, control flow, and operation of source code"
and further lists factors that affect it namely: following a consistent programming style (and naming conventions),
correct indentation, judicious commenting and wise decomposition.
Note that these important code qualities are essentially independent of the programming language being used.
</P>
<P><B>References</B></P>
<P>
<ul>
<li> [id://883757] ("The Joy of Legacy Code" section)
<li> [id://1114424]
<li> [id://744932]
<li> [id://776607]
<li> [id://418891]
<li> [id://553487]
</ul>
</P>
<P>
<ul>
<li> <a href="https://en.wikipedia.org/wiki/Computer_programming">Computer programming</a> (wikipedia) (See "Readability of source code" section)
<li> <a href="https://www.dreamsongs.com/Files/PatternsOfSoftware.pdf">Patterns of Software</a> by Richard Gabriel
<li> <a href="https://www.jwz.org/doc/worse-is-better.html">The Rise of Worse is Better</a> by Richard Gabriel
<li> <a href="https://www.oreilly.com/library/view/beautiful-code/9780596510046/">Beautiful Code</a> OReilly book by Andy Oram and Greg Wilson
</ul>
</P>
<P><B>References Added Later</B></P>
<P>
<ul>
<li> [id://656] by [faq_monk] (Oct 8 1999! 2-3 months before PM opened to the public!)
<li> [id://116172] by [dragonchild] (2001)
<li> [id://116247] by [dragonchild] (2001)
<li> [id://199348] by [disciple] (2002)
<li> [id://211998] by [vek] (2002)
<li> [id://606931] by [MaxKlokan] (2007)
<li> [id://631776] by [oyse] (2007)
<li> [id://684927] by [Boldra] (2008)
<li> [id://696839] by [Skeeve] (2008)
<li> [id://703286] by anonymonk (2008)
<li> [id://736395] by [ady] (2009)
<li> [id://889161] by me (2011)
<li> [id://1143884] by [ravi45722] (2015)
<li> [id://11136353] by [dazz] (2021)
</ul>
</P>
<P>
<ul>
<li> <a href="https://www.quora.com/What-determines-the-readability-of-a-programming-language">What determines the readability of a programming language</a> (quora 2017)
<li> <a href="https://news.ycombinator.com/item?id=29809642">Why is Perl so dwarfed in data science by Python?</a> (ycombinator, Jan 2022) (some comments about Python's magic powers of readability from data scientists in this long thread)
</ul>
</P>
<P>
<ul>
<li> [id://11134196] by me (2021) - the <a href="https://outspeaking.com/words-of-technology/why-perl-didnt-win.html">Why Perl Didn't Win</a> essay by [chromatic] argues (convincingly IMHO) that to remain popular over time, a programming language must be compelling for <B><I>new</I></B> projects ... while further noting this is <I>not solely a technical concern; it's a concern of the language community and ecosystem</I>.
</ul>
</P>
1202542
1202542