Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Computer programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Readability of source code=== 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. 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: *Different [[indent style]]s (whitespace) *[[Comment (computer programming)|Comments]] *[[decomposition (computer science)|Decomposition]] *[[Naming conventions (programming)|Naming conventions]] for objects (such as variables, classes, functions, procedures, etc.) The [[separation of presentation and content|presentation]] aspects of this (such as indents, line breaks, color highlighting, and so on) are often handled by the [[source code editor]], but the content aspects reflect the programmer's talent and skills. Various [[visual programming language]]s have also been developed with the intent to resolve readability concerns by adopting non-traditional approaches to code structure and display. [[Integrated development environment]]s (IDEs) aim to integrate all such help. Techniques like [[Code refactoring]] can enhance readability.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)