In the previous blog, I've shared my thoughts about functional
programming. Sometimes it looks like to me that procedural programmers
are side-effect addicted, whereas functional
programmers tend to have side-effect phobia. Hard-core functional
programmers
tend to spread the feelings that side-effects are evil. Yes, if the
side-effects are unnecessary, then they should be eliminated by all
means. But if the side-effects are desirable (by requirements), then
there's nothing evil about them. There's no impurity in a program if it
allows desirable side-effects.
Everyone agrees that side-effects should be controlled and carried out
in a structured manner. The question is how. I think the Holy Grail of
current programming language design is to find the best way to mix
procedural programming with functional programming. In the following
blog, I'm going to talk about the procedural design in Candle, and how
it compares to similar designs in languages, like Haskell, Erlang and
Clojure.