Boilerplate code

From Wiki @ Karl Jones dot com
Revision as of 05:54, 4 November 2015 by Karl Jones (Talk | contribs) (Created page with "In computer programming, '''boilerplate code''' (or '''boilerplate''') is the sections of code that have to be included in many places with little or no alteration. == De...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In computer programming, boilerplate code (or boilerplate) is the sections of code that have to be included in many places with little or no alteration.

Description

Boilerplate code is often used when referring to languages that are considered verbose, i.e. the programmer must write a lot of code to do minimal jobs.

The need for boilerplate can be reduced through high-level mechanisms such as:

  • Metaprogramming (which has the computer automatically write the needed boilerplate text)
  • Convention over configuration (which provides good default values, reducing the need to specify program details in every project)
  • Model-driven engineering (which uses models and model-to-code generators, eliminating the need for boilerplate manual code)

A related term is bookkeeping code, referring to code that is not part of the business logic but is interleaved with it in order to keep data structures updated or handle secondary aspects of the program.

See also

External links