Smash Company Splash Image

February 10th, 2016

In Technology

2 Comments











If you enjoy this article, see the other most popular articles




















If you enjoy this article, see the other most popular articles




















If you enjoy this article, see the other most popular articles

Why I hate all articles about design patterns

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com

Sometimes play is a lie

Imagine two children, both nine years old, decide to play tea. They rummage around in the closets of their respective parents. They dress up as they’ve seen their parents dress up. The one goes over to the other’s house.

“Mr. Worthington, it is so nice to see you,” says the girl who is acting as host. “Would you like some tea?”

“Why, yes, Mrs. Kentworth, I would be delighted to have some tea.”

The host brings an empty cup of tea to the guest, and the guest pretends to sip at it.

“Why, Mrs. Kentworth, this is such delicious tea!” says the little boy.

“I am so glad you enjoyed it!” says the other little girl.

They talk about their imaginary house and imaginary kitchen.

They are imitating the manners of their parents. This is how children learn. And when children are so young, there is no harm in it. Rather, it is cute and somewhat comical.

For better and for worse, people continue to play when they grow up. This is fine so long as the play is labeled as play. Joyful play is the starting point of creativity. But play becomes dangerous when the people who are playing convince themselves that they are doing real work. If the play is driven by a desire to avoid a difficult topic, then whatever game the adults are engaged in is likely to be destructive to their long-term interests. And such play can be insidiously difficult to spot if the people in question are hyper-intelligent and able to come up with seemingly reasonable justifications for what they are doing.

Imagine two programmers who spend all day discussing Design Patterns. Their conversation sounds like this:

“Why, Mister Yi! How shall we normalize our data? Is Fifth Form enough, or do we need Sixth Form?” said one.

“Why, Mister Kerr! What a delightful question! I suggest the Strategy Pattern. Let’s make normalization levels a configurable, pluggable behavior!”

They are playing.

I once worked at a small startup where the CTO and his buddies were working on a website that gave nurses a way to track patients medical information. When I first spoke with them, I was dazzled by their intellect. I recall our first conversation lasted 4 hours, during which we covered dozens of important topics: how many unit tests are enough, the trade-offs to be made when invalidating a cache, optimizations of TCP, the right length for Git commit messages, when to rebase, the advantages and disadvantages of polyglot programming, how to resolve inconsistency in a distributed database after a network partition, and so on.

Once I started to work with them, my impression of them changed. We had fantastic conversations but we were getting very little work done. Also, they were doing some unusual things, such as storing JSON strings in a text field in a PostGres database. They had done this before PostGres supported JSON. They had begun work in 2011, but they rejected all of the existing document databases (such as MongoDB or Riak). In 2013 they decided to work on version 2.0 of their software, which would be a complete re-write, but they decided to continue to keep JSON strings in PostGres. They liked some of the Python libraries that they had been working on, and they wanted to continue working on them. They were not even adapting to the fact that PostGres had begun to support JSON natively!

Was the work justified, or were they simply engaged in a hyper-intelligent kind of goofing off? This was for a website that was a fairly straightforward CRUD app. They could have used an existing framework (Django, Rails, Symfony, etc), which would have allowed them to develop much faster, and which already had many of the tools they were building. They had spent years doing work which should have only taken a few weeks. But using other people’s code to build a CRUD app is not fun.

Fun is important, because we should all have some fun at work, but at the same time, they were just sort of goofing off, adding in a thousand tasks which they felt were fun, and which let them avoid doing the work which the business actually needed.

Play at work falls into two types:

1.) Learning

2.) Avoidance

The first good, the second is bad. The kind of play that helps foster a deeper understanding of the craft of software is a good thing. But if a team is playing just because they are avoiding some difficult issue about their business model, or they want to avoid talking about their own perfectionism, then that is a real problem.

At the startup, where I worked in 2014, the team was consumed with its own perfectionism. In a sense, they were undone by their own competitive pressures. They admired each other, and they each wanted to win even more admiration from each other, so they were constantly doing complex things that earned real respect from any software engineer who heard about their exploits. But none of it had anything to do with the needs of the business.

I’ve worked for more than one client like this. I sometimes feel some frustration at what seems like too much emphasis on theoretical concerns. In urgent situations, I often suggest we cut a few corners so as to get some important work done. So, I sometimes say that I hate all articles about theoretical subjects such as Design Patterns. Too much theory!

But obviously that isn’t entirely true. My best known essay is “Object Oriented Programming Is An Expensive Disaster Which Must End“. Having invested thousands of hours into studying these topics, we all feel there must be some importance to them.

What is the real point of discussing theoretical issues? I write these essays because I want to write software in the most simple and direct way that I can, while still achieving the safety and reliability that the software needs. That is, I want to be more productive. I feel that discussing theoretical issues can be justified, especially if the articles give advice that really help developers get work done.

Get work done. In this I feel most articles about Design Patterns fail.

Perhaps I’m being unfair to Design Patterns, but those articles seem like the worst kind of tech writing, the most likely to inspire useless discussion that doesn’t help move a team forward. Catering to software developers perfectionism tends to be bad for business. And this particular type of article seems to be the most extreme in that regard.

We should all be on guard against the kinds of discussion that waste time without actually helping us advance the craft of software.

Source



Check out my books:





RECENT COMMENTS

August 18, 2019 8:57 pm

From Michael L on Americans increasingly hate each other

"You seem to have little patience for people who choose different tech paths than you. Although it looks like o..."

August 18, 2019 8:53 pm

From Michael L on Many of my Stackoverflow questions have been marked as duplicates even though they were not

"You don't suffer slights well, do you? Others who choose to waste time with dumb tech, do they keep you up at ..."

August 18, 2019 8:34 pm

From Michael L on Docker protects a programming paradigm that we should get rid of

"Me again. I've worked for a company that focuses on containerized applications for some time now. There is abs..."

August 18, 2019 8:00 pm

From Michael L on Docker protects a programming paradigm that we should get rid of

"To build on my last statement, I'm not trying to show that I'm "smarter." I'm probably not, or if I am, who gi..."

August 18, 2019 7:48 pm

From Michael L on Docker protects a programming paradigm that we should get rid of

"You think that containerization is going anywhere? I agree that it isn't strictly necessary, but you mistake y..."

August 18, 2019 7:40 pm

From Michael L on Docker protects a programming paradigm that we should get rid of

"If you weren't criticizing Docker, why did your frame the article as anti the Docker/Kubernetes/Python troika?..."

August 13, 2019 1:34 pm

From William Hatch on Docker is the dangerous gamble which we will regret

"No tool is every perfect, and you're certainly free to use whatever you want. But, I doubt very much the huge ..."

August 5, 2019 5:23 pm

From lawrence on Why does he want to throw his reputation away?

"DangerNorm, as to your last point, I was recently consulting with a startup that focused on the privacy of med..."

August 5, 2019 3:55 pm

From DangerNorm on Why does he want to throw his reputation away?

"This is tangential to the above point, but on the subject of mental health, I'll also take this chance to say ..."

August 5, 2019 3:51 pm

From DangerNorm on Why does he want to throw his reputation away?

"Your description of most people's response is correct, but I consider it to be a problem, rather than the corr..."

August 5, 2019 3:28 pm

From lawrence on Why does he want to throw his reputation away?

"DangerNorm, thank you for writing. I think you are missing the moral element here. You should understand the d..."

August 5, 2019 3:07 pm

From DangerNorm on Why does he want to throw his reputation away?

"It is true that a murderer is different from the flu virus in that murderers are moral agents and the flu viru..."

August 5, 2019 1:19 pm

From lawrence on Why does he want to throw his reputation away?

"ruurd, I'm not sure if you're responding to me or to DangerNorm, but this is true: "If you don’t get it the..."

August 5, 2019 1:09 pm

From ruurd on Why does he want to throw his reputation away?

"Oh yeah that argument. If you don't get it there is something wrong with you. Yeah right. I'll tell you what's..."

August 4, 2019 9:43 pm

From DangerNorm on Why does he want to throw his reputation away?

""Mass shootings are just not enough of a problem to be worth the attention given to it", is in fact an importa..."

2 COMMENTS

Pingback: New top story on Hacker News: Why I hate all articles about design patterns – Tech + Hckr News

March 5, 2018
12:21 am

By Soundararajan

You should immediately read the book “The Expert Beginner”.

Possibly your hate for design pattern originates from the hatred of your past.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>