What is the difference between declarative and procedural programming paradigms?

后端 未结 8 680
旧巷少年郎
旧巷少年郎 2020-12-07 08:00

What is the difference between the declarative and procedural programming paradigms? Could you please provide some examples?

What other programming

8条回答
  •  借酒劲吻你
    2020-12-07 08:18

    In procedural approach you encode your instruction to achieve the result. In the declarative approach you define what needs to be solved as the knowledge of solving the problem. Have a look at Procedural or Declarative approach example I implemented in both approaches.

    As you would see in the example, in declarative approach, you do not need to instruct HOW to solve the problem.

提交回复
热议问题