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
Indentation style
(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!
== Overview == This article primarily addresses styles for [[free-form language|free-form]] [[programming language]]s. As the name implies, such language code need not follow an indentation style. Indentation is a [[secondary notation]] that is often intended to lower [[cognitive load]] for a programmer to understand the structure of the code. Indentation can clarify the separation between the code executed based on [[control flow]]. Structured languages, such as [[Python (programming language)|Python]] and [[occam (programming language)|occam]], use indentation to determine the structure instead of using braces or keywords; this is termed the [[off-side rule]]. In such languages, indentation is meaningful to the language processor (such as [[compiler]] or [[Interpreter (computing)|interpreter]]). A programmer must conform to the language's indentation rules although may be free to choose indentation size. This article focuses on [[curly-bracket languages]] (that delimit blocks with [[curly bracket|curly brackets, a.k.a. curly braces, a.k.a. braces]]) and in particular [[List of C-family programming languages|C-family languages]], but a convention used for one language can be adapted to another language. For example, a language that uses <code>BEGIN</code> and <code>END</code> keywords instead of braces can be adapted by treating <code>BEGIN</code> the same as the open brace and so on. Indentation style only applies to text-based languages. [[Visual programming language]]s have no indentation.
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)