Declarative = WHAT you want
- Declarative programming is not coding how to do it, it is a programming method where you code what you want to do
The opposite
- Declarative ⇔ Imperative
- Imperative = HOW you want
Analogy
- Getting a cup of coffee
- Declarative: Just tell: 'Give me a cup of coffee'
- Imperative: Instruct how to make coffee
- Driving car
- Declarative: Automatic shift
- Imperative: Manual shift
https://twitter.com/gethackteam/status/1268892357027663873?s=20
Top comments (0)