Declarative vs. Imperative Programming
--------------------------------------

(By Mike English)

Make Me a Sandwich! (Imperative) Spread peanut butter
on one slice of bread. Set this slice of bread on a plate,
face-up. Spread jelly on another slice of bread. Place
this second slice of bread on top of the first, face-down.
Bring me the sandwich.

The Sandwich I Desire. (Declarative) There should be a
sandwich on a plate in front of me... It should have only
peanut butter and jelly between the two slices of bread.

Declarative programming is a more natural fit for managing
system configuration. We want to be talking about whether
or not MySQL is installed on this machine or Apache on that
machine, not whether yum install mysql-server has been run
here or apt-get install apache2 there. It allows us to
express intent more clearly in the code. It is also less
tedious to write and can even be more portable to different
platforms.


English, Mike, "From Imperative to Declarative System Configuration with Puppet," Atomic Spin, September 13, 2012, http://spin.atomicobject.com/2012/09/13/from-imperative-to-declarative-system-configuration-with-puppet/ )
