DELAPARRA
Index
Color
NL
Category: Programming paradigms

Declarative

Explained by Updated

What is Declarative?

Declarative: You describe the desired outcome: "give me all users where active = true". The system (SQL engine, React runtime) decides how to execute it. Declarative code describes the result you want, not the steps to get there. SQL is the classic example: SELECT * FROM users WHERE active = true says which rows you want, and the database decides how to find them.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Declarative

How is Declarative used in practice?

HTML, CSS, React components, Kubernetes manifests and Terraform files are all declarative. You describe the desired state, and an engine works out how to reach it.

What should you keep in mind with Declarative?

The benefit is that the code is shorter and closer to the intent, and the engine can optimise behind the scenes. The trade-off is less control. When performance matters, you sometimes need to understand what the engine does, for example by reading a query plan. Declarative tools work best when you trust the engine for routine work and know how to look underneath when needed.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with D

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.