Are Design Patterns How Languages Evolve?

Paul Graham’s essay, Revenge of the Nerds, is a nearly pornographic love letter to Lisp. If you can manage to read all the way to the end, there’s an interesting footnote buried at the bottom:

Peter Norvig found that 16 of the 23 patterns in Design Patterns were “invisible or simpler” in Lisp.

He should have opened the essay with that evidence, because it strengthens his conclusion considerably:

In the OO world you hear a good deal about “patterns.” When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I’m using abstractions that aren’t powerful enough – often that I’m generating by hand the expansions of some macro that I need to write.

There’s a Wiki entry called Are Design Patterns Missing Language Features? which expands and elaborates on Paul Graham’s hypothesis. It even has a handy chart of the classic Gang of Four patterns and the corresponding language features that implement each one. It then degrades into a weird little Wiki-fight, but the saner comments look like this:

Has anyone ever considered that design patterns are the way that programming languages evolve? In the same way as communicative language, commonly used abbreviations ( or patterns ) may become standard. In English words like “won’t” and “isn’t” are abbreviations, but are more or less considered standard words today. In the same way, ‘if-then-else’ or ‘do-while’ could be considered design patterns that have now become standard features in many languages. Perhaps later languages will include many design patterns as standard features.

According to Graham, Lisp is so malleable that design patterns immediately become part of the base language; they are indistinguishable from the original core language constructs. Lisp doesn’t need to evolve – it just instantly becomes. One wonders, then, why Lisp hasn’t become sentient and taken over the world by now. As Paul helpfully points out, it could be because we’re so stupid:

I also disagree that it is not believable that the vast majority of programmers have been boneheads for 40 years. It seems to me entirely possible.

All kidding aside, I tend to agree on two points:

  1. Excessive reliance on design patterns is indicative of failings in the language. As many commenters in the wiki point out, you’d see dozens of “design patterns” in assembly or C code; these are language features that we take for granted today. We’ve certainly seen evolution along those lines even in the modest lifetime of .NET so far. There are plenty of “syntactical sugar” constructs such as Using which encapsulate common patterns, and even more (such as Nullable and Generics) on the way.
  2. Languages evolve – slowly. It takes time to figure out the failings, shortcomings, and weaknesses of any language. Even Lisp. That’s why the the language family tree has roots going all the way back to 1954. New languages are created; old ones fall out of favor. And there’s a lot of cross-pollination between family trees. Almost all modern languages have a very complete implementation of regular expressions, which is one of the central features of the PERL language.

If anything, Lisp is strong evidence that computer language evolution is quite slow; it’s one of the oldest languages on the chart, and we’re still adapting features from it.

Jeff Atwood

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Overflow and Discourse. Disclaimer: I have no idea what I'm talking about. Let's be kind to each other. Find me https://infosec.exchange/@codinghorror

⏲️ Busy signing you up.

❗ Something's gone wrong. Please try again.

✅ Success! Check your inbox (and your spam folder, just in case).

Related posts

Updating The Single Most Influential Book of the BASIC Era

Updating The Single Most Influential Book of the BASIC Era

In a way, these two books are responsible for my entire professional career. With early computers, you didn’t boot up to a fancy schmancy desktop, or a screen full of apps you could easily poke and prod with your finger. No, those computers booted up to the command line.

By Jeff Atwood ·
Comments
To Serve Man, with Software

To Serve Man, with Software

I didn’t choose to be a programmer. Somehow, it seemed, the computers chose me. For a long time, that was fine, that was enough; that was all I needed. But along the way I never felt that being a programmer was this unambiguously great-for-everyone career field with zero downsides.

By Jeff Atwood ·
Comments
Here’s The Programming Game You Never Asked For

Here’s The Programming Game You Never Asked For

You know what’s universally regarded as un-fun by most programmers? Writing assembly language code. As Steve McConnell said back in 1994: Programmers working with high-level languages achieve better productivity and quality than those working with lower-level languages. Languages such as C++, Java, Smalltalk, and Visual Basic have been credited

By Jeff Atwood ·
Comments
Doing Terrible Things To Your Code

Doing Terrible Things To Your Code

In 1992, I thought I was the best programmer in the world. In my defense, I had just graduated from college, this was pre-Internet, and I lived in Boulder, Colorado working in small business jobs where I was lucky to even hear about other programmers much less meet them. I

By Jeff Atwood ·
Comments

Recent Posts

Let's Talk About The American Dream

Let's Talk About The American Dream

A few months ago I wrote about what it means to stay gold — to hold on to the best parts of ourselves, our communities, and the American Dream itself. But staying gold isn’t passive. It takes work. It takes action. It takes hard conversations that ask us to confront

By Jeff Atwood ·
Comments
Stay Gold, America

Stay Gold, America

We are at an unprecedented point in American history, and I'm concerned we may lose sight of the American Dream.

By Jeff Atwood ·
Comments
The Great Filter Comes For Us All

The Great Filter Comes For Us All

With a 13 billion year head start on evolution, why haven’t any other forms of life in the universe contacted us by now? (Arrival is a fantastic movie. Watch it, but don’t stop there – read the Story of Your Life novella it was based on for so much

By Jeff Atwood ·
Comments
I’m feeling unlucky... 🎲   See All Posts