🧭Declarative Programming
Also known as Declarative Code
Writing code that says what you want, and lets the tool work out how.
Think of it like
Think of it like ordering at a café. You say what you want, and the cook works out how.
Example
Lucy asks the database for each order over 50 euros. She never says how to find them. The database picks the way.
Why it matters
Saying what you want leaves room for the tool to find a faster way than you would.
Definition
Example code
sql
SELECT name FROM orders WHERE total > 50;Common mistake
Key takeaways
- 1Say what. Not how.
- 2The tool decides. It picks the steps.
- 3Shorter code. Often easier to read.