declarative
/dɪˈklæɹ.ə.tɪv/adjective
Declarative means describing the desired outcome without specifying every step the software must take to achieve it.
Our ad configuration is declarative: the file describes how the campaign should be configured.
A declarative approach records what you want to achieve. For example, a campaign should be active with a particular budget. The software then determines what needs to change. An imperative approach specifies the individual commands and the order in which they must run.
Start with the desired state
A familiar example is Glossary · In briefinfrastructure as codeInfrastructure as code (IaC) is a practice in which infrastructure is described in configuration files and created and managed using software.Read more with Terraform. You describe the infrastructure you want. Terraform compares that description with what already exists and determines what to create, change or remove. The Terraform documentation explains this declarative approach.
We use the same principle for our Google Ads campaigns. A text file might specify a desired daily budget of €30. If Google still has a budget of €40, our tooling proposes a change. If it is already €30, that budget needs no adjustment.
Declarative does not automatically mean changes are executed immediately. You can review the differences before executing changes. We inspect the Glossary · In briefdiffA diff is an overview of the differences between two versions of a file or two states. It shows what has been added, removed or changed.Read more before approving the changes.