Gabriel Sechan wrote:
Date: Thu, 25 Oct 2007 15:03:53 -0700
From: [EMAIL PROTECTED]
It is more than side-effect free. It is stateless, or more accurately,
"state is isolated". While no panacea, it is kind of a logical extension
of what OO is doing in terms of encapsulating state. The nice thing is
that the language and the developer is consequently very aware of state.
Given that most problems seem to come from state, this seems like a good
thing.
Completely and totally disagree. State does not cause problems- state is
usually the *solution* to problems. The problem comes from not encapsulating
state correctly.
This is another way of saying that state causes problems. ;-)
Encapsulation of state is one approach towards mitigating the problem.
If you fail to do it properly, you fail to mitigate, and you are back
with the original set of problems. Encapsulation is great, but it only
goes so far.
The fact that functional programming languages make state and side effects so
difficult to use are one of the reasons they have completely failed.
That's one way to look at it. The other way to look at it is that the
failure of other languages to address the issues of state and side
effects has resulted in programming being so difficult that programs are
laden with bugs and have such difficulty addressing concurrency and
security concerns. :-)
There's a reason why the most common design in electrical engineering is the
state machine- its simple, it works well, and it turns hard to impossible
problems into easily solved ones.
Yes, state machines are great. They make all problems easy, particularly
if you have billions of states with concurrent state transition events,
guarantees about isolation, state distributed across a WAN with
thousands of nodes, etc. It makes it so trivial to fully validate a
system. ;-) Furthermore, it's great that most programs tend to add
additional states that are otherwise unnecessary for solving a problem,
because that NEVER introduces new bugs or synchronization points. ;-)
--Chris
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg