Using Object Literals as Classes

John J Barton johnjbarton at
Fri Mar 16 21:33:19 PDT 2012

On Fri, Mar 16, 2012 at 6:28 PM, Allen Wirfs-Brock
<allen at> wrote:
> On this point, I probably should
> define what I mean by "declarative".  I consider code to be declarative, if
> a human (or an appropriately programmed machine) can understand its meaning
> without actually (or symbolically ) executing the code in its runtime
> environment.  In other words, its meaning is apparent from inspection rather
> than from evaluation.

CSS is declarative. Anyone who codes CSS knows it's meaning is not
apparent from inspection ;-).

I guess you don't mean 'declarative', but rather you mean what you
said: 'meaning apparent by inspection'.

Imperative forms easily pass such a test; that is why we have libraries.

In all of these forms the developer must 'symbolically execute' the
code to understand it. They must read top to bottom, left to right; as
they proceed they build up a mental model of the system state. If the
symbols or words are clear the reader and they understand the system,
they will succeed.

So the axis of interest is not declarative vs imperative.

The issue that your test addresses is context-free readability by
ordinary developers. Good syntax adds constraints and reduces text;
library function calls offer flexibility and shallower learning curve.
 Good solutions can be found with either.

Sorry for the meta excursion,

More information about the es-discuss mailing list