Computer programming: Difference between revisions

Content deleted Content added
m Added a reference
Tag: Reverted
revert - given source does not apply to the statement
Line 58:
In computer programming, [[readability]] refers to the ease with which a human reader can comprehend the purpose, [[control flow]], and operation of [[source code]]. It affects the aspects of quality above, including portability, usability and most importantly maintainability.
 
Readability is important because programmers spend the majority of their time reading, trying to understand, reusing, and modifying existing source code, rather than writing new source code.<ref>{{cite journal|url=https://doi.org/10.1145/2089155.2089171|title=Categorization of concerns: a categorical program comprehension model|journal=In Proceedings of the 3rd ACM SIGPLAN workshop on Evaluation and usability of programming languages and tools (PLATEAU '11)|pages=73–82|year=2011|last1=Frey|first1=Tim|last2=Gelhausen|first2=Marius|last3=Saake|first3=Gunter}}</ref> Unreadable code often leads to bugs, inefficiencies, and [[Code duplication|duplicated code]]. A study found that a few simple readability transformations made code shorter and drastically reduced the time to understand it.<ref>{{cite journal|doi=10.1145/358589.358596|title=Improving computer program readability to aid modification|journal=Communications of the ACM|volume=25|issue=8|pages=512–521|year=1982|last1=Elshoff|first1=James L.|last2=Marcotty|first2=Michael|s2cid=30026641|doi-access=free}}</ref>
 
Following a consistent [[programming style]] often helps readability. However, readability is more than just programming style. Many factors, having little or nothing to do with the ability of the computer to efficiently compile and execute the code, contribute to readability.<ref>{{cite web|url=http://docforge.com/wiki/Readability|title=Readability|author=Multiple (wiki)|work=Docforge|url-status=live|archive-url=https://web.archive.org/web/20200429211203/http://www.docforge.com/wiki/Readability|archive-date=2020-04-29|access-date=2010-01-30}}</ref> Some of these factors include: