A couple of years ago, I wrote about Kris Jenkins’ wonderful video that demonstrated interactive programming while building a Spotify client in Emacs Lisp. It’s one of my favorite videos and I’m still seeing it mentioned as new people discover it. Now Jenkins has a two-part post on functional programming that’s also worth your time.
Part One considers the question of what, exactly, functional programming is. Jenkins shapes his answer for the working programmer. It’s not, he says, about map
and reduce
or anonymous functions—although functional languages generally support these—but about recognizing and controlling side effects. This is more subtle than you might suppose but Jenkins does a good job of explaining what it means and why it’s important. All programmers should read this whether or not they’re interested in functional programming.
Part Two looks at several programming languages and asks to what extent they could be considered functional. These range from Java, the anti-functional language, to Haskell, a functional language on steroids. He also considers, JavaScript, Scala, Clojure, Perl, and Python. Of course, it’s possible to write in a functional manner in almost any language but some, like Java, actively discourage it.
If you’re a working programmer, you should definitely take a look at these two posts. Jenkins raises issues that you should consider regardless of the language you’re writing in or the paradigm you’re using.