[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: s-exprs + prototypes
> > Not allowing objects to have mutable state would weaken
> > the object
> > metaphor to the point where the average programmer would find it hard
> > to grasp.
> > The way humans perceive the real world, objects can and do have
> > mutable state.
> I think that many functional programmers (myself included) believe that
> functional programs are easier to reason about because they may easily be
> understood as the composition of many separate pieces. That is, when I want
> understand the behavior of an object receiving a message in a world with
> mutable state, I must consider all possible states of the object.
> If this object refers to other objects, I'm really stuck.
Then you are stuck for many common programming tasks: anything involving
interaction with system objects such as file or window handles, or other
external objects such as ActiveX objects, etc.
> A purely functional call, however, depends only on its inputs.
> There's a reason that mathematics is mathematical. I think that computer
> programming should take this approach as well.
But most programmers are not mathematicians, nor are most programming tasks
particularly mathematical in nature.
There is no question that the functional idiom is mathematically elegant. It
just just doesn't map very well to how most people think.