Declarative and Imperative Programming
In declarative programming
, we specify what we want to achieve rather than explicitly listing the steps to get there. In declarative languages, we focus on describing the desired result or outcome, and the language/framework takes care of determining how to achieve it.
HTML, CSS and SQL are some examples of declarative programming languages.
In imperative programming
, we explicitly write the algorithms and control flow statements, telling the computer how to execute the program step by step.
C, Java and Python are some examples of imperative programming languages.