Lably
Skip to content

Abstraction principle (computer programming)

  • 4 min read
  • 5 chapters

Related on Lably

Through Abstraction (computer science), Library (computing) and Object-oriented programming

When read as recommendations to the programmer, the abstraction principle can be generalized as the "don't repeat yourself" (DRY) principle, which recommends avoiding the duplication of information in general, and also avoiding the duplication of human effort involved in the software development process.

The principle

As a recommendation to the programmer, in its formulation by Benjamin C. Pierce in Types and Programming Languages (2002), the abstraction principle reads (emphasis in original):

Each significant piece of functionality in a program should be implemented in just one place in the source code. Where similar functions are carried out by distinct pieces of code, it is generally beneficial to combine them into one by abstracting out the varying parts.

As a requirement of the programming language, in its formulation by David A. Schmidt in The structure of typed programming languages (1994), the abstraction principle reads:.

The phrases of any semantically meaningful syntactic class may be named.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Computing and communication