Syntactic Salt

Syntactic Salt

Syntaktischer Zucker sind Syntaxerweiterungen in Programmiersprachen, welche der Vereinfachung von Schreibweisen dienen. Diese Erweiterungen sind alternative Schreibweisen, welche aber nicht die Ausdrucksstärke und Funktionalität der Programmiersprache erweitern.

Syntaktischer Zucker lässt sich durch reine Textumformungen auf Grundelemente der Sprache zurückführen („desugared“, dt. entsüßen).

Der Begriff Syntactic Sugar wurde von dem britischen Informatiker Peter J. Landin geprägt.

Beispiele

Ein Beispiel für Syntaktischen Zucker ist die Behandlung von Feldern in der Programmiersprache C. C unterscheidet streng genommen nicht zwischen Zeigern auf Objekte und Zeigern auf Felder von Objekten. Zeigt die Variable p auf ganze Zahlen (Typ int), so kann man mit *(p+3) auf die dritte ganze Zahl im Speicher nach der Adresse p zugreifen. Dies kann man in C auch kurz schreiben als p[3].

Ein weiteres Beispiel für syntaktischen Zucker ist die Infix-Schreibweise in Programmiersprachen. Bei der Infix-Schreibweise steht das Operationszeichen zwischen den Operanden, z.B. 3 + 5. Dies kann von einem Übersetzer direkt in die klassische Schreibweise eines Funktionsaufrufes add(3,5) übertragen werden.

Syntaktisches Salz

Das Gegenstück zum syntaktischen Zucker ist das Syntaktische Salz – eine Spracheigenschaft, die das Schreiben schlechten oder schlecht lesbaren Codes erschwert, ohne dabei die Funktionalität zu erweitern.

Beispielsweise muss man in manchen Sprachen eine Schleife oder bedingte Verzweigung mit end while bzw. end if statt eines einfachen end beenden (z.B. bei SPSS).


Wikimedia Foundation.

Игры ⚽ Поможем решить контрольную работу

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Syntactic sugar — is a computer science term that refers to syntax within a programming language that is designed to make things easier to read or to express. It makes the language sweeter for humans to use: things can be expressed more clearly, more concisely, or …   Wikipedia

  • Salt (disambiguation) — Salt is an edible mineral used as a flavor enhancer and preservative for food, but may also refer to: Chemistry * Salt (chemistry), a neutral compound composed of ions. * Sodium chloride, the main ingredient in edible salt * Sea salt, is a less… …   Wikipedia

  • Синтаксический сахар — Эта статья нуждается в дополнительных источниках для улучшения проверяемости. Вы можете помочь улучшить эту статью, добавив ссы …   Википедия

  • sel syntaxique — ● loc. m. ►LANG Caractéristique ajoutée à un système formel, comme un langage informatique, pour forcer l attention de ses utilisateurs. La déclaration obligatoire des variables est par exemple du sel syntaxique. Voir sucre syntaxique. En anglais …   Dictionnaire d'informatique francophone

  • Speech act — For the US Act, see SPEECH Act of 2010. Speech Act is a technical term in linguistics and the philosophy of language. The contemporary use of the term goes back to John L. Austin s doctrine of locutionary, illocutionary, and perlocutionary acts.… …   Wikipedia

  • Origin of the Romanians — History of Romania This article is part of a series Prehistory …   Wikipedia

  • Question — For other uses, see Question (disambiguation). For questions about Wikipedia, see Wikipedia:Questions. “ There are these four ways of answering questions. Which four? There are questions that should be answered categorically [straightforwardly… …   Wikipedia

  • Donkey pronoun — A donkey pronoun is a pronoun that is bound in semantics but not syntax.[1][2] Some writers prefer the term donkey anaphora, since it is the referential aspects and discourse or syntactic context that are of interest to researchers (see anaphora) …   Wikipedia

  • HEBREW LANGUAGE — This entry is arranged according to the following scheme: pre biblical biblical the dead sea scrolls mishnaic medieval modern period A detailed table of contents precedes each section. PRE BIBLICAL nature of the evidence the sources phonology… …   Encyclopedia of Judaism

  • level — Synonyms and related words: IC analysis, accommodate, accordant, address, adjust, aim, akin, alabaster, align, aligned, alike, alkali flat, alluvial plain, altitude, amount, appositive, arrowlike, assimilate to, at full length, at par, attribute …   Moby Thesaurus

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”