Answer the question
In order to leave comments, you need to log in
What is the difference between imperative and declarative programming?
What's up, software.
What are the advantages of either approach?
If you're not sure, don't answer.
I've read enough of the theory, and seen a number of examples, but I still don't get the practical gist.
In what situations should I use functional languages, in what procedural languages, in what OOP?
Answer the question
In order to leave comments, you need to log in
The main difference is that the declarative language describes a set of rules, what the result should be without describing how this result is obtained (for example, html, css, prolog), while the imperative language describes how to get the result in the form of a sequence of actions.
imperative - when you order, like an emperor: do this and more often.
declarative - when you push something, like a poof in the Senate, but they do it according to their own understanding
In general, it seems to me that it is a mistake to classify functional languages and functional programming as declarative. Classically declarative programming is PROLOG and all similar tools... which are also called logic programming.
So the categories are: imperative, functional, declarative... what else? (who is bigger?).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question