Indentation
Encyclopedia
An indentation may refer to:
  • A notch
    Notch
    Notch may refer to:* The nock of an arrow* Notch , a Hip hop, R&B, reggae, dancehall and reggaeton artist* Notch signaling pathway, a cell signaling system present in most multicellular organisms...

    , or deep recesses
    Alcove
    Alcove , a vault) is an architectural term for a recess in a room, usually screened off by pillars, balustrades or drapery.In geography and geology, the term Alcove is used for a wind-eroded depression in the side of a cliff of a homogenous rock type, famous from sandstones of the Colorado Plateau...

    ; for instance in a coastline, or a carving in rock
  • The placement of text farther to the right to separate it from surrounding text.


The first meaning is also applied in hardness measurement as in indentation hardness
Indentation hardness
Indentation hardness tests are used to determine the hardness of a material to deformation. Several such tests exist, wherein the examined material is indented until an impression is formed; these tests can be performed on a macroscopic or microscopic scale....

.

For an example of the second meaning, this is an indentation of one non-breaking space
Non-breaking space
In computer-based text processing and digital typesetting, a non-breaking space or no-break space is a variant of the space character that prevents an automatic line break at its position. In certain formats , it also prevents the “collapsing” of multiple consecutive whitespace characters into a...

:

 Indented block because this is something

and this is an indentation of two non-breaking spaces:

  Indented block 2
In the written form of many language
Language
Language may refer either to the specifically human capacity for acquiring and using complex systems of communication, or to a specific instance of such a system of complex communication...

s, an indentation is often used at the beginning of a line to signal the start of a new paragraph
Paragraph
A paragraph is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. The start of a paragraph is indicated by beginning on a new line. Sometimes the first line is indented...

.

Outdentation is a neologism used in computer circles to describe placing text back to the left again.

Some languages (e.g. Hebrew and Arabic) are written right-to-left, and if indentation is used, in the above "left" and "right" should be swapped when referring to such languages.

Indentation in typesetting

There are two main types of first-line indent: normal and hanging. A "normal" indent indents the first line, as shown here, an indent of one centimeter:
'

The other kind, a hanging indent, indents the rest of the text while leaving the first line in place; as shown here with a hanging indent of one centimeter:
'

Indentation in programming

In computer programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

s, indentation is used to format program source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

 to improve readability. Indentation is generally only of use to programmers; compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

s and interpreters
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

 rarely care how much whitespace is present in between programming statements. However, certain programming languages rely on the use of indentation to demarcate programming structure, often using a variation of the off-side rule
Off-side rule
A computer programming language is said to adhere to the off-side rule if the scope of declarations in that language is expressed by their indentation. The term and the idea are attributed to Peter J. Landin, and the term can be seen as a pun on the offside law of football .- Definition :Peter J...

. The Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

, Occam
Occam (programming language)
occam is a concurrent programming language that builds on the Communicating Sequential Processes process algebra, and shares many of its features. It is named after William of Ockham of Occam's Razor fame....

, and Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

 programming languages rely on indentation in this way.

Debates over where to indent, whether to use spaces or tab
Tab
Tab or tabs may refer to:* Tab, a British Army term for a loaded march* Tab , by Monster Magnet* Tab , a small protective covering for the fingers* Tab , the mechanism for opening a beverage can...

s, and how many spaces to use are often hotly debated among programmers, leading some to classify indentation as akin to a religious war
Religious war
A religious war; Latin: bellum sacrum; is a war caused by, or justified by, religious differences. It can involve one state with an established religion against another state with a different religion or a different sect within the same religion, or a religiously motivated group attempting to...

. Different indentation styles
Indent style
In computer programming, an indent style is a convention governing the indentation of blocks of code to convey the program's structure. This article largely addresses the C programming language and its descendants, but can be applied to most other programming languages...

 are commonly used. In 2006 a third method of indentation was proposed, called elastic tabstop
Elastic tabstop
In text editor applications in computing, elastic tabstops are an alternative way to handle tabstops, with a primary focus on editing source code in computer programming. The idea was first proposed by Nick Gravgaard as a solution for programmers who argue about what kind of indentation is best;...

s.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK