|
|
|
|
|
by btilly
1758 days ago
|
|
Understanding the difference between declarative and imperative programming is rather hard with all the abstractions we have today. The distinction is are you telling the computer *how* to do it, or telling it *what* steps to take. If, even with access to all of the code, you'd have to ask the computer how it chose to do it to figure out what it did, you have a declarative system. If the code reads like instructions for a recipe, it is imperative. The complications come with the fact that these two paradigms do not describe all of the possibilities. Notably object oriented and functional designs are neither imperative or declarative. (But may share some features with both.) |
|
Theory is one thing, but actual programming languages are something different. An "impure" mix.
So, when people told my language X is imperative and language Y is declarative, I got confused, because they often had parts of both.