January 25, 2006 spout

Imperative vs. Declarative

Savas showed me this great example from a book he’s reading. Consider this:

F = m * v

Using an imperative interpretation, this is a expression that, when evaluated, multiplies m and v, putting the result into F.

Using a declarative interpretation, this is an equation and is completely equivalent to the following:

m = F / v

The imperative interpretation allows me to execute. The declarative interpretation allows execution as well as addition reasoning.