DEV Community

Discussion on: Imperative vs Declarative Programming

Collapse
 
jasmin profile image
Jasmin Virdi • Edited

Imperative programming is definitely a good way to begin as it provides a conceptual model that is very easy to understand. Many of the OOP languages like C++ and Java are designed on the basis of imperative programming.

I have worked on BackboneJS which primarily supports imperative programming. The lack of two way binding due to which one had to specify the templates, models, and event listeners every time leads to loss of productivity and manageability.
On the other hand, the new javascript frameworks like React, Vue, and Angular are based on a declarative approach. In these frameworks, we are mainly dealing with the main component and the framework is responsible for performing all the Javascript/ DOM operations to get the desired result.

When working on large scale applications we often prefer the declarative programming approach as it provides the following:

  • Increased readability and maintainability
  • Easier reiterative development
  • Easier testing and debugging