[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

naturally imperative? [was: Curly braces]

Vladimir G Ivanovic <vladimir@acm.org> writes:

> I also believe that one of the reasons for Java's popularity is
> that it more closely matches the imperative way we actually behave: we
> perform actions on objects for their side effects, e.g. toasting a
> bagel.

But programming isn't about doing things.  Object code is about doing
things.  Program code is about describing how to do things.

Describing how to do something step-by-step from the beginning is a very
unnatural process, even for things you do yourself.  It takes much
practice and training to describe things this way.

More naturally, we tend to describe things at a high level first, then,
when pressed, we fill in the details as to how we got there.  If the
person we're explaining it to still doesn't get it, only then do we
exert the mental effort to try to recall every step in sequence.

For a popular example of non-imperative programming, look at the
Standard Query Language for databases (SQL).  An SQL query is a
description of a data set you want to retrieve, but it bears no
resemblance to a step-by-step description of how to get that data.  It's
up to the database server to choose an efficient plan from multiple
possible plans.

<brlewis@[(if (brl-related? message)    ; Bruce R. Lewis
              "users.sourceforge.net"   ; http://brl.sourceforge.net/