Declarative Versus Imperative Code
Terminology and differences in programming paradigms
Believe it or not, you are likely already using multiple programming paradigms as a developer. Because there is nothing more fun than entertaining your friends with programming theory, here is an article that will help you recognize popular paradigms in your code.
For updated information please consider my new post Imperative Vs. Declarative Programming In JavaScript or watching my new YouTube video:
Imperative Code
Imperative programming is how we started with Assembly (1949) and continued with languages like C, C++, C#, PHP, and Java. Procedural and object-oriented programming belong under the imperative paradigm.
Your code is based on statements that change the program state by telling the computer how to do things. In other words, your code is based on defining variables and changing the values of those variables.
It is the ideal programming paradigm for people who have a less-than-innocent…