syntactic salt
The opposite of syntactic sugar, a feature designed to make it harder to write
bad code. Specifically, syntactic salt is a hoop the programmer must jump
through just to prove that he knows what's going on, rather than to express a
program action. Some programmers consider required type declarations to be
syntactic salt. A requirement to write "end if", "end while", "end do", etc. to
terminate the last block controlled by a control construct (as opposed to just
"end") would definitely be syntactic salt. Syntactic salt is like the real thing
in that it tends to raise hackers' blood pressures in an unhealthy way. Compare
candygrammar.
[Jargon File]
Nearby terms:
syncronous « synflood « synonym ring « syntactic
salt
» syntactic sugar » syntax » Syntax-Case
syntactic sugar
Term coined by Peter Landin for additions to the syntax of a language which do
not affect its expressiveness but make it "sweeter" for humans to use. Syntactic
sugar gives the programmer an alternative way of coding that is more succinct or
more like some familiar notation. It does not affect the expressiveness of the
formalism (compare chrome).
Syntactic sugar can be easily translated ("desugared") to produce a program in
some simpler "core" syntax. E.g. C's "a[i]" notation is syntactic sugar for "*(a
+ i)". In a (curried) functional language, all operators are really functions
and the use of infix notation "x+y" is syntactic sugar for function application
"(+) x y".
Alan Perlis once quipped, "Syntactic sugar causes cancer of the semicolon."
The variants "syntactic saccharin" and "syntactic syrup" are also recorded.
These denote something even more gratuitous, in that they serve no purpose at
all. Compare candygrammar, syntactic salt.
Nearby terms:
synflood « synonym ring « syntactic salt «
syntactic sugar » syntax » Syntax-Case » syntax
directed translation
|