The Case for Privacy (in Clojure)
How to Run Across a Lake

An Apology of Sorts: Functional Languages Are (Still) Overrated

Two years ago, I stood on my soapbox and yelled. I told the FP community that their languages were bad, and that they should feel bad. It was a post full of vitriol and frustration, but also a little bit of truth. I believed then (and still do) that functional languages are a poor solution if what you're looking for is a way to get B grade programmers to build scalable, concurrent systems. After trying to learn Erlang, Haskell, and then Scala, I couldn't see how using those languages was easier that just using separate processes, stitched together with message passing infrastructure, to build systems at scale. And with these thoughts running through my head, I vomited on the Internet. Then Hacker News picked it up.

As is the custom on the web, almost none of the people who left comments actually tried to refute the central point of my post. Most of the responses I got were as angry and bitter as the post itself. I guess that's more evidence that, in this world, you get what you give. Thankfully though, some commenters were kind enough respond to my anger with offers of help. Some shared (rather excellent) resources for learning, others simply offered encouragement. But the most striking thing was a pattern that emerged from the comments that did offer a counter to my central point. They all said the same thing: Try Clojure.

After working with Clojure for the better part of this year, I can see why. Clojure is truly a joy. So much so, in fact, that I'm using it for some production systems at DRW, and on some of my side projects. Many of these systems are highly concurrent, doing work on dozens (and sometimes hundreds) of threads in parallel. The code is easy to reason about, easy to read, and easy to test. So I have to apologize for taking what was a reasonable critique of various people promoting FP, and wrapping it in a very poorly written rant. If I had decided to learn Clojure first, and had some success with it, maybe my post on FP would have been a little less rant-y.

Even so, I'm glad to see that what got me so worked up in the first place has started to fade. People no longer seem to be equating The Death of Moore's Law to "Everyone must learn functional programming, now. I understand why it's sometimes necessary to use hyperbole and bold claims to get people's attention. Once you have their attention, you can get your real point across. I just wish the focus back then was more on "[language] is awesome because of [language/platform feature]" and less about how we're all going to be out of a job unless we learn Caml (see what I did there?).

In some ways, I feel like the FP community made the same mistake that people made with OOP 15 years ago: They turned a good idea into a fad. It moved the discussion away from the true merits of a language, and into the realm of doom, gloom, and hypothetical situations. People could clearly see that there is more than one way to skin a cat, especially on the web, where scale is often a requirement. But some FP proponents tried to cast the end of Moore's law as the end of all imperative programming...which is just silly. In any case, I think the fad is over, and most of what's left is truly good and useful. Introducing a functional language into your codebase still won't turn your team of B grade .NET developers into a bunch of roflscale ninja rockstars, but I don't think anyone's implying that anymore.

Let me end by passing on the advice that was given to me over two years ago: If you still haven't tried Clojure, I really suggest that you do. The 4Clojure puzzles are a great way to get started. They're actually quite simple (until they're not...that's the fun).

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Instance100500

I agree with you on the main point: functional languages are overrated

Dilbert Deinstein

Reading your previous post, no wonder you like Clojure. :) It's impure in the functional sense, but this also means it's more practical to get some things running quickly. In a way, like comparing Visual Studio designer-made WinForms apps with true MVC apps. You can argue that the first approach gives results faster, but you can test MVC much easier, and it forces you to structure things to be easily extended. Besides that, Clojure runs on JVM, which is a plus from your perspective.

But the point in FP is simply that it's different from OOP. You need to **take some time** to get used to it. Emphasis on pure functions, recursion and pattern matching is a completely different way of doing things, and you cannot expect to grasp this over night.

Dilbert Deinstein

And btw, the "seriously, what the hell" links in your original article are not that frightening. It's like trying to learn C++ and then stumbling on an article like this: http://www.unixwiz.net/techtips/reading-cdecl.html (check "A hairy example" and try to imagine what a beginner would say to that).

Mark Ramirez

I agree that Functional Languages are very useful, and yet, considered overrated.

I consider many developers that consider themselves as "Object Oriented" (included myself), more like "multiparadigm oriented".

Unless you compare C++ and Object Pascal developers with Java and C# developers, and you see the difference.

I learn LISP at my Collegue years, and still find it useful. Even, if a solution for a problem can be solved in several programing paradigms, there will be on that can be more suitable than others.

And, sometimes will be functional, and sometimes not.

Cheers.

Tiborvass

Try Go programming language. It's not functional although functions are first-class citizens. However, you can have easily 1 million goroutines running concurrently. It is for me the best way of doing concurrency.

The comments to this entry are closed.