Answer the question
In order to leave comments, you need to log in
Is declarative programming just using the abstractions already in the library?
Let's take the task - to write a function that cooks scrambled eggs.
Imperative Programming
cook_egg (number):
take egg
break egg
put it on pan
....etc
return eggs
cook_egg(number):
return standard_library.cook(eggs, number)
Answer the question
In order to leave comments, you need to log in
No. In your example, this is still imperative programming.
Declarative is when you describe the result, but how to achieve it is no longer your problem.
For example, HTML markup is declarative
Configs is also declarative
In a sense, SQL is also declarative
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question