Thinking in FP vs OOP for large scale apps => Re: [plt-scheme] Imperative programming : missing the flow

From: Joe Marshall (jmarshall at alum.mit.edu)
Date: Wed May 16 12:57:09 EDT 2007

On 5/15/07, Grant Rettke <grettke at acm.org> wrote:
>
> "Enterprise projects" are usually about moving data around, modifying
> it, analyzing and reporting on it.

I want to disagree with part of this.

Enterprise projects accumulate data, move it around, grovel through it
(mining), analyze it, and report on it.  All other things considered
equal, enterprises would rather *not* modify data, but instead
supersede it and archive the old.

This isn't exactly common, yet, but as storage has become so cheap,
more and more enterprises are trying to keep their old data around as
an audit trail and for data-mining purposes.  It is becoming more
common that enterprises run their databases in `append only' mode.

Enterprises also realized a long time ago that modification of data
must be tightly controlled, especially if it is going to be depended
upon for a long time.  The transaction model was developed to deal
with this.

So I think that although it may not be a conscious decision, you can
already see that enterprises don't like modification of data.

I'm not sure I explained my thoughts on this clearly, so feel free to
ask clarifying questions.



So where does the functional programming come in?  If you have no
primitives that can modify the data, it is *trivial* to avoid all the
problems associated with mutation.  (There is the problem of
non-determinism that shows up.)

I was involved in a company developing enterprise-level
change-management software.  We used a model where the changes were
immutable and composable (like deltas).  We *never* deleted or
modified a change, we just accumulated more and more of them.  The
code was naturally `macro-functional' in that all large-scale
operations were strictly functional.  (At a small scale there were
bits of mutation here and there, but that was for efficiency).  It
became clear to me that functional programming provides enormous
advantages for this project because as complex as things got, you
could be pretty sure that the data was safe and secure.




-- 
~jrm


Posted on the users mailing list.