DEV Community

Takuya Kikuchi
Takuya Kikuchi

Posted on

Declarative programming?

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 Image 2021-07-24 at 9.20.01 AM

https://twitter.com/gethackteam/status/1268892357027663873?s=20

Resources

Discussion (0)