boilerplate

Repetitive code that has to be written the same way every time and adds little meaning of its own.

In more detail

Boilerplate hides the interesting part of the code among routine parts. Languages and tools add features, such as generated methods, to remove it.

Examples

Java: hand-written equals, hashCode, toString and getters for a data class; records remove them.
The course's CGI scripts end with boilerplate that prints the Content-type line and shows errors in the browser.
Manual loading flags, try...catch rollback code and hand-written useMemo calls are typical React boilerplate that Actions, useOptimistic and the React Compiler remove.

Related terms

Taught in

References