Syntactic sugar

From JargonWiki

Jump to: navigation, search
The Jargon File

Parts of this article are based on the Jargon File, v. 4.4.7,
a public domain document of hacker jargon.

Image:Glider-small.png
syntactic sugar
Usage: n.
Derivation: Coined by Peter Landin

See Also: chrome, candygrammar, syntactic salt


syntactic sugar: n.

[coined by Peter Landin] Features added to a language or other formalism to make it `sweeter' for humans, but which do not affect the expressiveness of the formalism (compare chrome). Used esp. when there is an obvious and trivial translation of the `sugar' feature into other constructs already present in the notation. C's a[i] notation is syntactic sugar for *(a + i). "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis.

The variants syntactic saccharin and syntactic syrup are also recorded. These denote something even more gratuitous, in that syntactic sugar serves a purpose (making something more acceptable to humans), but syntactic saccharin or syrup serve no purpose at all. Compare candygrammar, syntactic salt.

Sources

Source: syntactic sugar, in The Jargon File, version 4.4.7.


Public Domain

This article is in the public domain and is not subject to copyright, trademark, or any other legal protection of intellectual property.
Any and all user contributions to this page are also immediately dedicated to the public domain.
Editors of this page must accede to these terms as special conditions of the standard editing privileges.

Image:Public_Domain_sm.png
Toolbox