Self-documenting

Self-documenting

In computer programming, self-documenting (or self-describing) is a common descriptor for source code that follows certain loosely-defined conventions for naming and structure. These conventions are intended to enable developers, users and maintainers of a system to use it effectively without requiring previous knowledge of its specification, design, or behavior.cite book
first = Stephen R.
last = Schach
title = Object-Oriented and Classical Software Engineering
publisher = McGraw-Hill Professional
year = 2004
id = ISBN 0072865512
] cite web
title = The Myth of Self-Describing XML
url = http://www.oceaninformatics.biz/publications/e2.pdf
accessdate = 2007-05-12
] [(See e.g., Use-mention distinction, Naming collision, Polysemy)]

Overview

The concept of self-description is not exclusively a property of certain kinds of source code. This concept has application to several areas in computer science, notably in computational linguistics and formal language theory. Additionally, self-describing systems may involve other areas in computing such as application design and user interfaces. Nevertheless, "self-documenting" is a term commonly used to designate a particular style of writing applied to source code for programming languages, markup languages and the like.

The designation of "self-documenting code" is often applied in a general sense, and not thoroughly defined according to a rigorous and exacting standard. Nevertheless, there are certain objectives, conventions, and practical considerations that usually apply when users of a system refer to this concept.

Objectives

Commonly stated objectives for self-documenting systems include:

* make source code easier to read and understand;
* minimize the effort required to maintain or extend legacy systems;
* reduce the need for users and developers of a system to consult secondary documentation sources; and
* facilitate automation through self-contained Knowledge representation.

Conventions

Self-documenting code is ostensibly written using human-readable names, typically consisting of a phrase in English which reflects the symbol's meaning, such as "numberOfWordsInThisArticle" or "TryOpen". The code must also have a clear and clean structure so that a human reader can easily understand the algorithm used.

Practical considerations

There are certain practical considerations that influence whether and how well the objectives for a self-documenting system can be realized.

* uniformity of naming conventions
* consistency
* scope of the application and system requirements

Examples

An example of self-documenting software is TeX. When running on its own source code, TeX can produce a file with the complete printable documentation of itself.

Notes and references

ee also

* Literate Programming
* Comment

External links

* Jef Raskin on Self-documenting code: http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=290&page=1.
* Steve McConnell's [http://cc2e.com/Page.aspx?hid=218 High Quality Routines checklist] in his book Code Complete helps to facilitate the creation of self-documenting code.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • self-documenting — self docˈumenting adjective (of a computer program) that informs the user how to use the program as it runs • • • Main Entry: ↑self …   Useful english dictionary

  • Self-reconfiguring modular robot — Modular self reconfiguring robotic systems or self reconfigurable modular robots are autonomous kinematic machines with variable morphology. Beyond conventional actuation, sensing and control typically found in fixed morphology robots, self… …   Wikipedia

  • Emacs — infobox software caption = GNU Emacs 22.0.91.1 with multiple buffers and syntax highlighting for LaTeX, C#, and C. developer = the GNU project author = Richard Stallman released = release year|1976 frequently updated = yes programming language =… …   Wikipedia

  • XML — Infobox file format name = Extensible Markup Language icon = logo = extension = .xml mime = application/xml, text/xml (deprecated) type code = uniform type = public.xml magic = owner = World Wide Web Consortium genre = Markup language container… …   Wikipedia

  • COBOL — For other uses, see COBOL (disambiguation). COBOL LANGUAGE Paradigm(s) procedural, object oriented Appeared in 1959 (1959) Designed by Grace Hopper, William Selden, Gertrude Tierney, Howard Bromberg, Howard Discount, Vernon Reeves, Jean E.… …   Wikipedia

  • ODD (Text Encoding Initiative) — ODD stands for One Document Does it all . Part of the Text Encoding Initiative, it is an XML based format for writing human readable descriptions of XML files.[1][2] ODD allows its users to customize the P5 version of the TEI XML formats by… …   Wikipedia

  • Extensible Markup Language — (XML) Desarrollador World Wide Web Consortium Información general …   Wikipedia Español

  • Assembly language — See the terminology section below for information regarding inconsistent use of the terms assembly and assembler. Motorola MC6800 Assembly Language An assembly language is a low level programming language for computers, microprocessors,… …   Wikipedia

  • GIMP — Infobox Software name = GIMP caption = GIMP 2.6.0 running on KDE. developer = [http://developer.gimp.org/ The GIMP Development Team] released = 1995 frequently updated = yes programming language = C platform = Cross platform language =… …   Wikipedia

  • Domain-specific language — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computing …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”