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


  • 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


Discussion (0)