It’s been 15 years since the publication of the seminal Gang of Four Design Patterns book. Since I was a reviewer of the original manuscript and also have a quote on the back cover of the book, the publisher recently asked me if I would write my thoughts about how I view the book today and how I think it’s affected software development over the past 15 years. You can find my essay along with essays by Linda Rising and Josh Bloch on the 15th anniversary web page for the book. There’s also an interview with the authors linked there, which I found interesting in part because of the similarity between what the authors say about patterns and functional languages and what I wrote in my essay on the same topic.

Responses

Re: “patterns have existed for a long time in FP, and most of the time they’re just part of the language.”

As someone from the OO universe and with only limited experience of FP I am still pretty confused about DPs in FP. Clearly, the book was about OO patterns. But I have not seen any serious discussions of topics such as “DPs for FP languages, especially language-independent” or FP analogs of multiple OO development methodologies (from RUP&UML to DDD).

Does it mean that FP magically avoids all the problems addressed by dozens of books on OO/DPs/etc? Or something like the SICP book implicitly addresses such concerns? Are OO people a self-selected group of alternatively gifted who need numerous books on trivial matters while FP folks learn by osmosis?

15 years already, seems like yesterday! Despite GoF being OO centric I’ve never had any trouble ‘translating’ them to FP or to CEP or event/stream-oriented languages.

There’s certainly a lot more boilerplate required in the OO forms. I agree that FP aren’t necessarily required in FP/EDA as much as in OO. But GoF succeeded most of all in providing a lingua franca for programmers/architects to communicate more effectively by sharing a common understanding and foundation.

I believe if you look at Gabriel’s “Theory of Technology Acceptance” and plugin pure/non-pure FP Languages vs. OO languages + FP constructs (Such as VB.NET or C# 3.0 with LINQ which is Haskel’s Monads) then you might find that the future just might be dominated by “Worse is Better” OO languages + FP constructs, and not “The Right Thing” FP languages, so patterns just might be with us for longer than you might think.

@Tony: while there may be a “dominant” language in the industry at one point or another, I personally use multiple languages, regardless of their perceived popularity, to best solve problems.

For example, Erlang will continue to play a huge role in any projects I’m involved in for the foreseeable future, at my current employer or at any future employers, regardless of how “dominant” it is, and that’s perfectly acceptable for the type of people for whom I like to work because they see the clear values of productivity, reliability, concurrency, hot upgrading, speed of development, maintainability, and code brevity that Erlang brings to production systems. I’ll continue to use Perl and Python and Ruby and Tcl wherever they fit well. I’ll apply Java (if possible via Clojure, Scala, or Jython) or C++ or C if I need them. I don’t use Haskell or OCaml in production today but it could happen in the future. (I don’t touch Windows anymore so I don’t mention any F#, C#, etc.) It’s all about getting there quickly with a system that performs well without acquiring an unmaintainable mess along the way.

Worrying about what language is “dominant” is pretty pointless, don’t you think? Seems like that way of thinking would apply best to people who think building a system is most effectively accomplished by paying 100 developers of average or less capability rather than paying 10 great developers.

And finally, I don’t believe I said or implied anything about patterns going away. I simply said that the GoF “Design Patterns” were focused on OO, not FP, and that different patterns exist for the latter, often built into the languages themselves. In their interview I linked to, the GoF authors expressed similar thoughts, and of course Peter Norvig’s presentation linked in a previous comment pretty much says it all.

I am surprised you think my comment had anything to do with a dominate language, since as you know I use many types of languages, don’t believe in “one true way”, and even turned you on to Python, and believe that I am pragmatic..

Having said that, and looking past languages, do think trends happen and I think there is a current evolution trend emerging in OO languages.

What I see it that OO languages that use either lazy dynamic runtime typing or eager compile time typing, are being increasingly be influenced by FP constructs for working with collections of values, immutability, pattern matching for dispatch, strong typing with type inference, higher-order functions, lazy evaluation, Monadic effects to specify side-effects, etc..

What I was trying to point out is that I am inclined to think right now that OO languages + these FP features and using an FP style is a more likely to be the evolutionary trend then a move away from OO toward the list of functional languages that you have in your essay. Thus I think the programmer will get to choose their own way to architect their solutions using patterns that might be more OO then FP or more FP then OO.

@Tony: I think it depends on the language and the scenario. In my experience, OO developers who come to FP quickly lose the OO and latch onto the FP, and they don’t look back. But if they were using a language that supports both OO and FP, then sure, they’d use both, but IMO they’d do so only because it was possible, not because it’s a better way.