1. 11

  2. 3

    Thanks for unearthing this post. Definitely shaped my thinking about Ruby/FP/OOP back in the day (two years ago counts as back in the day, right? Geeze)

    1. 2

      Nice post, thanks. By coincidence I was looking around for some good “learn some advanced JavaScript” links, and recalled there being some site that explained functional programming in JS. Except, as it turns out, that’s not what it was called at the time. The article (actually I found a few) was about higher-order programming, or HOP (as a few places referred to it).

      It got me thinking how hip and cool functional programming had become, to the point that many people are keen to describe their pet language as a functional programming language. Or that their pet language lets you do functional programming. For example, JavaScript, Python, and Ruby (the languages I see most coming up in such discussions).

      Thing is, none of these languages can assure immutability or referential transparency. What they offer, to varying degrees, is the ability to use functions as data (i.e. pass functions to functions, and return functions from functions), and for that the term “higher-order programming” makes more sense than “functional programming.”

      This is the kind of thing that leads to flame wars over what defines a functional programming language, but data immutability is, for me, an essential aspect of it, and I’m glad this article jumps right in on that.