Declarative vs Imperative

Many programming challenges can be tackled by a combination of two approaches, declarative and imperative (or procedural). These notes are from Dan McCreary's sample training materials.

McCreary refers to the Parker projection (Jason Parker, Nov 2006), which states that over time, imperative (procedural) code tends from 100% of the codebase towards zero, while declarative code does the opposite.

Imperative (How)

 * Stepwise algorithms, instructions
 * Written by programmers and software engineers
 * Examples:
 * Java, C++, C#, C, Assembly Code, Python, Ruby, PHP

Declarative (What)

 * Pattern matching languages and graphical tools
 * Created by Business Analysts (BA) or designers using graphical notation and tools
 * Examples:
 * HTML, Cascading Style Sheets (CSS), Apache Ant, XML Schemas, XML Transforms, XML Configuration Files, Workflows and XForms