Software design patterns began as an idea about buildings, not code

Software design patterns began as an idea about buildings, not code
Image: Intellect (generated)

In short: Long before programmers adopted them, an architect named Christopher Alexander described reusable solutions to recurring problems in buildings and towns. Software engineers later borrowed the idea. A design pattern is not code to copy, but a template for solving a common problem in many settings. Its origins, its critics, and its limits reveal a lot about how good software is built.

A software design pattern is best understood as a template for handling a problem programmers keep meeting, rather than a block of code to paste into a project. The same template can be adapted across different programming languages and computing platforms. Many people regard patterns as formalized best practices, a way of capturing lessons that experienced developers have learned through difficulty and passing them on. The idea began outside computing. Christopher Alexander introduced patterns as an architectural concept in 1977 in his book A Pattern Language. Computing picked it up in 1987, when Kent Beck and Ward Cunningham tried applying patterns to programming and shared their findings at the OOPSLA conference that year. Patterns became widely known in 1994, when four authors called the Gang of Four published their influential book on reusable object-oriented design. Their shorthand, GoF, is still common today.

Patterns are not without debate. Object-oriented patterns usually describe how classes or objects relate and collaborate without fixing the final application classes. Some patterns that depend on changing state may fit poorly with functional programming languages. Others can become unnecessary when a language has built-in support for the problem they address. Peter Norvig argued that 16 of the 23 patterns in the GoF book were simplified or removed entirely in Lisp or Dylan, which suggests that the need for a pattern can hint at a feature a language is missing. Used carefully, patterns can speed up development and make code easier to read for anyone familiar with them. Used carelessly, they add complexity. Patterns also often introduce extra layers of indirection to gain flexibility, which can make a design harder to follow and slow it down at runtime. The best use of a pattern is a deliberate choice, matched to the real forces in the problem.

Intellect curates this card from the research pack; read the original sources to go deeper.

Opens the Intellect+ feed with this card first. Swipe up for the next one.

Sources

To cite this card, link to https://intellectplus.co.uk/app/technology-software-design-pattern.

How we source, check and correct cards: Editorial standards.

General information, not professional advice. Spotted an error? Flag the card or see corrections and complaints.

Intellect Plus is a visual educational discovery platform for exploring fascinating facts and ideas. Brain Food, Not Brain Rot. What is Intellect Plus?

Related

Finding something worth knowing…