Boilerplate

Boilerplate

Boilerplate ((auch: Abbinder) oder engl. ursprl. Kesselplatte, Kochplatte, übertragen Standardtext, Textbaustein) bezeichnet einen gleichbleibenden Textblock meist am Ende eines Texts. Im Zusammenhang mit E-Mails wird der Begriff auch im Zusammenhang mit der Signatur benutzt. Der Begriff wird sowohl in der Medienarbeit und dem Druckwesen[1] als auch in der Programmierung verwendet.[2]

Inhaltsverzeichnis

Public Relations

Boilerplate oder Backgrounder ist ein Begriff aus der PR- und Medienarbeit. Es handelt sich dabei um eine Textpassage am Ende einer Medienmitteilung. Sie enthält die wichtigsten allgemeinen Angaben zur Organisation, welche hinter der Medienmitteilung steht (z. B. Anzahl der Mitarbeiter des Unternehmens, Umsatz, Standorte, Branchenschwerpunkte, Gründung).

Die Boilerplate ist somit ein über einen längeren Zeitraum gleichbleibender Textblock ohne direkten Bezug zum aktuellen Anlass, welcher inhaltlich im Zentrum der Medienmitteilung steht. Die Boilerplate bietet Journalisten die Möglichkeit, auf einen Blick das Tätigkeitsprofil einer Organisation bzw. eines Unternehmens zu erfassen.

Programmierung

In der Programmierung bezeichnet der Begriff boilerplate code Codefragmente, die an vielen Stellen in mehr oder weniger unveränderter Form benötigt werden. Das kommt häufiger vor in Programmiersprachen, die als eher „geschwätzig“ (verbose) gelten, d. h. dem Programmierer auch für geringste Aufgabenstellungen viel Codierarbeit abverlangen. Der Bedarf an Boilerplate-Code kann durch Nutzung von high-level Mechanismen wie Metaprogrammierung (wobei das System den benötigten Boilerplate-Code automatisch generiert) und Methodikbausteine wie Convention over Configuration (wodurch „gute“ Defaultwerte zur Verfügung gestellt werden, so dass viele Implementierungsdetails nicht mehr in jedem Projekt ausdrücklich spezifiziert werden müssen) reduziert werden.

Die folgenden Perlzeilen zeigen beispielhaft Boilerplate-Code. Sie bestehen aus einem Shebang und zwei Pragmata (die der gute Programmierstil verlangt) am Anfang einer Quelldatei. Diese Zeilen sind nicht Teil der Programmlogik, sondern enthalten Information für die Ablaufumgebung.

#!/usr/bin/perl
use warnings;
use strict;

Boilerplate-Code wird häufig zur Vorbereitung der Benutzung von Funktionen aus Bibliotheken mit niedrigem Abstraktionsniveau benötigt. Ein Beispiel hierfür ist die strcat Function in C zum Zusammenfügen zweier Zeichenketten. Da C keinen String-Datentyp kennt, werden Strings als nullterminierte character arrays dargestellt. Der Code, den man braucht, um (jedenfalls auf eine Art) mit strcat zwei Strings namens first und second zu verketten, lautet in ausführlich kommentierter Fassung, aber ohne notwendige Fehlerbehandlung:

char *result;
 
/* Allocate memory for the size of the two strings, plus 1 for the terminating NULL character. */
result = malloc(strlen(first) + strlen(second) + 1);
 
/* Copy the contents of 'first' to 'result'. */
strcpy(result, first);
 
/* Append the contents of 'second'. */
strcat(result, second);/* Deallocate the reserved memory when finished */
free(result);

Die Variablendeklarationen und die Anweisungen malloc und free sind der Boilerplate-Code, der als Rahmen für die eigentliche Arbeit der beiden Funktionsaufrufe vorausgesetzt und somit zusätzlich geschrieben werden muss.

Siehe auch

Einzelnachweise

  1. Donald Treadwell, Jill B. Treadwell: Public Relations Writing. Principles in Practice. SAGE, 2003, ISBN 9780761945994.
  2. Ralf Laemmel, Simon Peyton Jones: Scrap your boilerplate: a practical approach to generic programming. In: Proceedings ACM SIGPLAN Workshop on Types in Language Design and Implementation. 2003 (Webseite, PS).

Wikimedia Foundation.

Игры ⚽ Поможем сделать НИР

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

  • boilerplate — boil·er·plate / bȯi lər ˌplāt/ n: standardized text in documents (as contracts) Merriam Webster’s Dictionary of Law. Merriam Webster. 1996. boilerplate …   Law dictionary

  • Boilerplate — may refer to: * Boilerplate, a relatively thick sheet of high quality steel, suitable for building boilers * Boilerplate (text), text (or program code) that can be used in a variety of situations * Boilerplate (robot), a fictional combat robot *… …   Wikipedia

  • Boilerplate —   [dt. »Kochplatte«], Textbaustein …   Universal-Lexikon

  • boilerplate — (n.) newspaper (and now information technology) slang for unit of writing that can be used over and over without change, 1893, from a literal meaning (1840) metal rolled in large, flat plates for use in making steam boilers. The connecting notion …   Etymology dictionary

  • boilerplate — [boil′ərplāt΄] n. 1. steel rolled in large flat plates, used in making steam boilers ☆ 2. syndicated features or fillers that are relatively timeless, sent to newspapers, formerly as stereotype plates, now often by wire, mail, or computer ☆ 3. a… …   English World dictionary

  • Boilerplate — Standard terms and conditions. The New York Times Financial Glossary * * * boilerplate boil‧er‧plate [ˈbɔɪləˌpleɪt ǁ lər ] noun [countable] LAW an agreement, contract etc with standard wording: • Another piece of boilerplate that it is probably… …   Financial and business terms

  • boilerplate — Standard terms and conditions. Bloomberg Financial Dictionary * * * boilerplate boil‧er‧plate [ˈbɔɪləˌpleɪt ǁ lər ] noun [countable] LAW an agreement, contract etc with standard wording: • Another piece of boilerplate that it is probably useful… …   Financial and business terms

  • boilerplate — 1. adjective a) Describing text of a standard or routine nature. The contract contained all the usual boilerplate clauses. b) Used to describe a non functional spacecraft used to test configuration and procedures. A boilerplate spacecraft was… …   Wiktionary

  • boilerplate — boil|er|plate [ˈbɔıləpleıt US ər ] n [U and C] AmE a standard piece of writing or a design for something that can be easily used each time you need it, for example in business or legal documents →↑template ▪ a boilerplate for a fax message ▪… …   Dictionary of contemporary English

  • boilerplate — UK [ˈbɔɪlə(r)ˌpleɪt] / US [ˈbɔɪlərˌpleɪt] noun [countable/uncountable] Word forms boilerplate : singular boilerplate plural boilerplates mainly American a template (= a standard way of writing something that can be copied) used in legal documents …   English dictionary

Share the article and excerpts

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