Saturday, October 27, 2012

Functionalism Versus Objectivism (again)

Yes, the title is a joke, as there's no global fixed namespace for these "isms" -- you can read whatever you like into these inkblots.

However, I have a definite Versus in mind, the semi-feud between the Haskellians, the Knights who say "Ni!" to the Objectivists, those who are object oriented, and proud of it I might add (come to our Proud to be Objects Day parade sometime).

By Haskellian, I mean the broader camp of Lambda Calculus lovers who discourage side effects and hidden state changes.  Pure functional programming keeps the expressions just saying what they mean, whereas Objects are capsules of secrecy, making proof quasi-impossible; the transparency is just not there.

Objectivists are in the "wizard with wand" school and the Actions (spells) may be redolent with side effects, especially on globals (environmental variables).  Since structured programming days, we've been discouraged from hanging ourselves with all the slack that we're given.  Perhaps too few of us took heed, and now the frustrations of end users are aimed at us, for all our bugs.  If Windows had been written in Haskell, we wouldn't be where we are today (I don't disagree by the way).

My lurking suspicion is if the compass needle had flipped the other way, and functional programming were more at an apex in power, there'd be a counter-culture of Objectivist die-hards exclaiming about the purity of their new mental model, the one with state machines passing messages around, networks of agents, like "turtles" (or was that "tractors" and miss-translated?).

In any case, I'm quite admiring of Haskell's implementation of a type safe system with a kind of inheritance or polymorphism.  I find some similarities with Python, not just differences.  I also find it charmingly steam-punky in its retro neo-Victorian-sounding metaphysics.  "Don't be afraid of Monads, they're just where we get more imperative-seeming with our do [not dot] notation and stuff."  When they need to "talk to the real world" they let the Monads come between them, and their Shangri-La of pure functionality.  "You from the real world?  Talk to the Monad, please".

I don't mind "teaching the controversy" as some Creationists used to put it, but to steer clear of computer languages in general, scared away by this feud, is just too high a price to be paying.  We're sacrificing way too many ready-to-learn-somethings.  "Better both than neither" will be my Mantra of the Day (MOTD).