DEV Community

Laxman Nemane
Laxman Nemane

Posted on

1

Imperative and Declarative programming

Imperative and Declarative programming

Through examples, we can better understand the following concepts:

Imperative programming is like giving a recipe to a chef, where you specify every single step, ingredient, and cooking technique to achieve a desired dish. You're controlling the flow of the program, step by step.

On the other hand, declarative programming is like ordering a restaurant dish. You specify what you want (the desired outcome), and the chef (the programming language or framework) determines how to make it happen. You don't need to specify the steps, conditions, or implementation details.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more