1
1
123qwe2015-11-28 14:50:02
Programming
123qwe, 2015-11-28 14:50:02

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

3 answer(s)
D
Dmitry Belyaev, 2015-11-28
@bingo347

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.

A
alexxandr, 2015-11-30
@alexxandr

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

O
Oleg Tsilyurik, 2015-11-28
@Olej

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 question

Ask a Question

731 491 924 answers to any question