What is Declarative Programming
dev.to·2d·
Discuss: DEV
Flag this post

I. Declarative vs. Imperative

What is declarative programming? Generally, our understanding of declarative is relative to imperative. Turing taught us the essence of imperative and endowed it with a mathematically precise definition: a stateful machine that executes step by step according to explicit instructions. Declarative, on the other hand, can be seen as the opposite of imperative. Some have said: everything that is not imperative is declarative. In this sense, the further one deviates from the image of a Turing machine, the more declarative it is.

Therefore, Functional Programming is declarative because it does not use mutable state and does not require specifying any execution order (it can be assumed that all functions execute simultaneously due to referential transpa…

Similar Posts

Loading similar posts...