Programming languages In most
programming language syntax, whitespace characters can be used to separate
tokens. For a
free-form language, whitespace characters are ignored by code processors (i.e.
compiler). Even when language syntax requires white space, often multiple whitespace characters are treated the same as a single. In an
off-side rule language,
indentation white space is syntactically significant. In the
satirical and contrarian language called
Whitespace, whitespace characters are the only significant characters and normal text is ignored. Good use of white space in
source code can group related logic and make the code easier to understand. Excessive use of whitespace, including at the end of a line where it provides no rendering behavior, is considered a nuisance. Most languages only recognize whitespace characters that have an ASCII code. They disallow most or all of the Unicode codes listed above. The
C language defines whitespace characters to be "space, horizontal tab, new-line, vertical tab, and form-feed". The
HTTP network protocol requires different types of whitespace to be used in different parts of the protocol; it requires single space characters between items in the
status line, a CR/LF pair at the end of a line, and "linear whitespace" in header values. Whitespace in XML element content is not changed in this way by the parser, but an application receiving information from the parser may choose to apply similar rules to element content. An XML document author can use the xml:space="preserve" attribute on an element to instruct the parser to discourage the downstream application from altering whitespace in that element's content. In most
HTML elements, a sequence of whitespace characters is treated as a single
inter-word separator, which may manifest as a single space character when rendering text in a language that normally inserts such space between words. Conforming HTML renderers apply literal whitespace behaviour to certain elements: those inside tags, and those where
CSS property white-space is set to or . In these elements, space characters will not be "collapsed" into inter-word separators. In
MediaWiki markup, as well as the there is an optional tag, which also preserves whitespace. It requires Extension:Poem. In both XML and HTML, the
non-breaking space character, along with other "non-standard" spaces, is not treated as collapsible whitespace.
File names Such usage is similar to multiword file names written for operating systems and applications that are confused by embedded space codes—such file names instead use an
underscore (_) as a word separator, as_in_this_phrase. Another such symbol was . This was used in the early years of computer programming when writing on coding forms.
Keypunch operators immediately recognized the symbol as an "explicit space". It was used in
BCDIC,
EBCDIC, and
ASCII-1963. == See also ==