Once upon a time, back when men wore parachute pants and women wore fingerless gloves, there was a software crisis. The demand for new software exploded in the 1980s as PCs started penetrating small and retail businesses (running a Swatch boutique was hard enough, but at least you could keep your inventory on a Zip disk), and corporate departments started going rogue with sophisticated spreadsheets and easy-to-program database-oriented “fourth-generation languages.” Demand outstripped supply, and a gap rapidly grew between the focus of the mainstream paradigm (systems analysis and Structured Design) and the day-to-day problems being faced (brittle codebases, customers too busy to review even a few hundred rows of the requirements matrix, and the emergence of graphical user interfaces).
Fast-forward to today, when we wear… I dunno, whatever’s trending on Pinterest, I guess. There is a software crisis. Single-core programming is on its last legs. We’ve carved out a niche and a buzzword (“Big Data”) to pretend that all of us aren’t going to be in a world of trouble when clients start realizing they’re waiting around for results and we’re only using 1/8th, 1/16th, 1/32nd of available processing power. A gap has rapidly grown between the focus of the mainstream paradigm (object-oriented programming) and the day-to-day problems being faced (infrastructure dependencies, legacy codebases and under-utilized processing capacity).
One advantage OOP had over Functional Programming (FP) is the undivided attention developers had on GUIs. Every developer (and I mean every developer) had customers demanding dropdown menus and mouse support, and these things are, as we all know, hard to do properly using top-down imperative programming. There was a very strong (if somewhat erroneous) association between GUI programming (demanded) and OOP (perhaps worth learning). This was so pervasive that Steve Jobs, when he introduced NeXTStep 2.0 in 1990, demonstrated programming with Interface Builder as one of that system’s core advantages.
Today’s industry isn’t nearly as focused on manycore, even though it’s a much bigger problem than the relatively trivial problem of learning new mobile or touch APIs. And although there’s a vague association between FP and concurrency, it is not so definitively linked in the minds of the mainstream. There are still far too many developers who think that “the OS will take care of it” or “I’ll use a library,” or who don’t even realize that the current mainstream concurrency model (developer-controlled threading with shared mutable state) is far more dangerous and difficult than manually managing memory.
The lack of a mainstream commitment to move toward FP makes the cliquish attitude of the FP community all the more problematic. In the late 1980s and early 1990s, there was a virtual tidal wave of great communicators like Rebecca Wirfs-Brock, Kent Beck, Ward Cunningham and many others. For many, including myself, it was Grady Booch’s “Object-Oriented Design with Applications” (later expanded to include Analysis) that bridged the gap, but there were probably a dozen equally excellent texts aimed dead center at the mainstream (and since then, there have been more great introductory texts such as the recent “Head First OOA&D”).
There is no equivalent effort that is visible from the FP community. The closest might be Microsoft’s Channel 9 website, which has had courses on Haskell taught by LINQ-creator Erik Meijer and, as you’d expect, many resources on F#.
I think the .NET community suffers the least from the smugness issue: Microsoft understands developer training and quashes public pettiness between language advocates, and F# is both well-regarded in the functional community and fully integrated into Visual Studio. I’ve also liked videos coming out of the Brisbane Functional Programming Group.
But for mainstream books, I’ve yet to see anything close to a pretender for the crown of “the next Booch.” The best book on FP I’ve read is “Learn You a Haskell for Great Good” by Miran Lipovaca, but I see that book as a great textbook for a class, not as a mainstream tutorial. There are some very good language texts, including Martin Odersky et al.’s “Programming in Scala,” and Bryan O’Sullivan et al.’s “Real World Haskell,” but I don’t think these books will walk people over the bridge between their current worldview and that of FP.
Academics don’t need practical, well-written texts (insert snarky comment here). Functional programming and modern type-systems will be touchstones of language designers in the coming years. And as I’ve said before, mainstream programming has already adopted functional techniques. But I’m no longer confident that there will be a broad mainstream paradigm shift and embrace of the label “functional programming.” If there is to be such a shift, we need a new cohort of teachers who understand both functional and mainstream programming, and who can communicate the advantages of FP without dismissing the successes of OOP. Any takers?
Larry O’Brien is a technology consultant, analyst and writer. Read his blog at www.knowing.net.