Declarative programming is often defined as any style of programming that is not imperative [Imperative programming]. A number of other common definitions attempt to define it by simply contrasting it with imperative programming. For example:

  • A high-level program that describes what a computation should perform.
  • Any programming language that lacks side effects (or more specifically, is referentially transparent)
  • A language with a clear correspondence to mathematical logic.

These definitions overlap substantially.

Declarative programming is a non-imperative style of programming in which programs describe their desired results without explicitly listing commands or steps that must be performed. Functional [Functional programming] and logical programming [Logic programming] languages are characterized by a declarative programming style.

(“Declarative Programming” 2023)