Two Minutes Hate: “Why Functional Programming is a Pointless Dead End”

Okay, folks. Don’t forget what the Judges said: “So programmers should worry less about languages and more about good old complexity.” You can take from that the lesson that, for hard problems, raw analytical power and mathematical ability is more important than “coding skills.” But what the judges were talking about was the fact that while C programmers could get away with a slightly more “brute force” approach, a good data structure implemented in Haskell would have been fast enough to do the job as well. The issue was not so much one of language choice, but raw problem solving.

But I really don’t understand the hate that keeps emerging in this discussion. “After three years of functional programming I’m nearly out of that dark cave I’ve been living in, and back into this real world…. At least for me, functional programming seems to have been an infatuation – well worth the time spent on it but ultimately not useful.” Why the religious tone? He might say the same thing for all of those years he spent dabbling in Zen or Christianity.

I keep seeing similar “anti-testimonies” cropping up. Stuff like, “Oh I studied that in university.” Oh yeah… like going to university can make anyone an expert on programming. Others claim to have “tried” Haskell or have “looked into” functional programming. This supposedly gives them the authority to dismiss functional programming languages altogether, and maybe accuse the egg-heads of being lazy… in the “wrong” way.

Admit it guys, this is pretty shallow. I think it’s perfectly okay to pick a random church in your area, show up randomly, and decide that maybe Christianity is not for you. Just like its okay to look at a few random news items from the last years and conclude that Islam is a violent religion. Just like you can shave your head and eat vegetarian food as a Hare Krishna for a few months before getting bored with it. But while there’s not much chance of us ever (collectively) coming up with an agreed upon standard for judging the merits of the major world religions, I think we do have a means at our disposal for judging the merits of your opinion of functional programming: it’s called blogging.

Pick an off-beat language. Start studying. Attempt hard things. Write up your solution in a “show and tell” fashion. Try to become a better programmer. Then give us your opinion on whether or not you’d like to use Haskell or Lisp or whatever instead of your usual language. At least then we can have an objective way of judging your skill and depth of experience.

I don’t care about your “testimony”. It doesn’t add one whit to your credibility whatsoever. Programming is not a religion; show me your code! Tell me what’s hard for you and how you’re overcoming your limitations. If you’ve learned something cool, put it in a format where even I can understand it. Chances are that the way things are going, you’ll be able to apply the bulk of what you learn in your non-functional language anyway. But please… support your opinion with real code examples.

Advertisements

3 Responses to “Two Minutes Hate: “Why Functional Programming is a Pointless Dead End””

  1. Mark Miller Says:

    Smalltalk is commonly seen as a “research language”. Lisp is viewed the same way. That’s why you hear people say, “Oh yeah. I used that in college.”

    I have also read a couple testimonials that are like what you’ve seen, but about Smalltalk. One I read said the guy had used it for a while, I don’t know how long, maybe a few months or a few years, and then said he went to PHP, because he wanted “to get s__t done”. I think one of the things he said he got frustrated by is there’s no “start point” to anything. Everything is just a collection of classes and objects.

    The impression I get is these people worked with it, but they never truly got why it was valuable. That may sound like I’m stating the obvious, but I think it’s worth stating. What I mean is you can work with a language, but if you’re thinking like you did in your old language, you’re totally missing the point. My guess is these disappointed/disaffected folks programmed in the new language as if it was an exercise in learning a new syntax. They grokked as much of the new semantics as they had to to survive in it, but otherwise they didn’t understand the spirit in which the new language was created. That last statement may sound like psychobabble, but it’s not. If you don’t understand the mode of thinking that went into creating the language in the first place, you’re probably misusing it, and have therefor become frustrated by it, or don’t see how it’s any different from the other language you’re more familiar with. You might think, “Ah heck, language X can do this just as well.”

    I ran into this with a blog post I wrote called “Squeak is like an operating system”. One of the comments I got (in a “sequel” to this post) was from a guy who said he had worked with Smalltalk, and had felt frustrated by it, but understanding that it had qualities of an OS helped him make sense of his experience with it. This is what I’m talking about. Perception is a huge part of the problem here. Once you get that right things start clicking into place in your head.

    What I’ve discovered so far is that understanding why one should use Smalltalk involves much more than learning the syntax and the class library. You can understand it at that level, and use it, but you’re not getting what’s truly powerful about it. What’s really powerful is understanding how it enables a different model of programming and computing.

    One of the complaints I’ve had about the Smalltalk community is there’s not much help WRT mapping traditional CS concepts to how Smalltalk does things. I think this is what turns a lot of people off to it.

  2. lispy Says:

    If you’re learning a new language just to translate what you’re used to into a slightly different syntax, then you’re wasting your time. If you only know one language– or one family of languages– then you probably don’t even know what a programming language is. I didn’t truly understand 6th grade grammer until I started studying French in highschool. Until you broaden your horizons you assume a special case is simply being the way things are. And you fail to comprehend how language restricts your ability to even imagine certain concepts.

    I don’t believe I began to learn how to program until I started learning Lisp. Everything before this was just reconfiguring someone else’s system or automating someone else’s API.

  3. Mark Miller Says:

    Until you broaden your horizons you assume a special case is simply being the way things are. And you fail to comprehend how language restricts your ability to even imagine certain concepts.

    There’s a contentious theory that says the same thing, called Sapir-Whorf. It says that language systems tend to constrain the thoughts people can have. It may even say that expanding the languages one knows allows one to expand the thoughts they can have. I haven’t looked at it in detail. Not everyone accepts this, but it’s an interesting idea.

    What drew me into this stuff was reading Eric Raymond’s quote (read it in Paul Graham’s “Beating The Averages” article) that learning Lisp will make you a better programmer even if you never use it for a real world project. I think it has more to do with expressing concepts easily. There might be ways to bring what you’ve learned into a weaker language system, but it’ll be a real chore. There’s more friction, so you’re less likely to try it.

    I don’t believe I began to learn how to program until I started learning Lisp. Everything before this was just reconfiguring someone else’s system or automating someone else’s API.

    Interesting perspective. What you’re talking about is a common developer experience. A lot of programmers only work on something other people have written. I’ve had some experience with creating software from scratch, mostly in C. What I find dissatisfying about my former experience is the weakness of the languages I worked with. There were just some things they couldn’t do easily, and I felt I had to live with those limitations, partly because there didn’t seem to be people in the community who could teach me how to do more powerful things. Everyone “swam” in the same ideas.

    I remember I really had to search for a while to find someone who could explain to me how to databind to objects in .Net 1.1. It turned out to be not that hard, and hugely beneficial. But most .Net developers didn’t know how to do this, as far as I could tell, because there was no official documentation on how to do it. Then I found out about the value of code generators, like CodeSmith, which were basically meta-languages in XML (yuck!).

    Another thing I didn’t like was the computing culture that surrounded the languages I used to work with. They tended to encourage a “learn it” culture, where you had to learn how the computer worked, and how to “get it” to do what you wanted. Or, you had to learn an API. That’s the current fashion nowadays. Learning the language is easy. You can learn it in a few weeks. It’s learning the APIs, kind of a clunky meta-language, that takes a long time.

    What I like about the Smalltalk culture, anyway, is it encourages me to examine my notions of computing itself, that it can be something that’s closer to the way I think, rather than how the underlying hardware, or even the VM thinks. It’s the idea that the machine should come closer to the person, rather than the person being forced to come closer to the machine or VM. There is still some of that with these systems. You have to describe how you think to the system, before you can describe what you want to do with that system of thinking that you have. It’s a two-stage process. At least that’s my conception of it at this point.

    A challenge that I think is inevitable is the situation where you have to understand how someone else thinks: where you or I have to work with a Smalltalk/Lisp system that someone else wrote. Then we’re back to the same problem of working with what’s already been established, but we have a system that’s much more flexible and powerful to work with. Perhaps there’s a way to, again, describe to the system how you or I think about what the other developer wrote, so, again, we can think of it in the way that’s natural for you or me. Or perhaps it would be better to just distill it down for ourselves to the idea that the other programmer actually invented, keep that, and then describe your own interface to it, rather than use the one that’s already there. I have no idea how to tackle this scenario yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: