Smash Company Splash Image

February 10th, 2016

In Technology

2 Comments

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 book:





RECENT COMMENTS

October 18, 2018 7:15 pm

From Ahmed O Ali on The multiplicity of truth during the era of the Internet

"I think that the old attempts to unify the truth are the result of power, but today we are going to facts that..."

October 9, 2018 11:18 am

From Justin McGuire on Susan Kare invented the modern world

"I picked up her ICONS book a while back. It's an inspirational little art book, great for a geeky coffee table..."

September 20, 2018 5:23 pm

From Wayne on Have I been shadowbanned from Hacker News?

"Yep. I was also shadow banned from hacker news. Also, I saw a guy get banned from Hacker News for commenting t..."

August 27, 2018 1:04 pm

From Dave Paola on What's wrong with Hacker News

"I agree completely, although HN does support RSS feeds for user comments. I use this to follow people I respec..."

August 21, 2018 11:48 am

From Nanacy on AWS does not protect you from devops

"Very good post. Please have look for AWS and DevOps Training online or corporate ..."

August 18, 2018 4:59 am

From Cat Mara on How to deal with a psychopath

"One of my favorite passages in the book. Like a lot of people in tech, I'm pretty introverted & would do a..."

August 17, 2018 9:37 am

From Richard Caldwell on Poland was shockingly liberal during the 1400s

"We may not have been taught this in school, but it wasn't forgotten by the Powers That Be. Whereas today’s mor..."

August 17, 2018 8:23 am

From Mikołaj Hołysz on Poland was shockingly liberal during the 1400s

"Most of this is not taught in polish schools either. I'm a pole myself and I haven't been taught most of those..."

August 17, 2018 7:01 am

From ignaloidas on Poland was shockingly liberal during the 1400s

"I'm glad to see that people start to learn this part of history. I'm not from Poland, but from Lithuania, and ..."

August 17, 2018 6:52 am

From Tom on Poland was shockingly liberal during the 1400s

"Thanks for this great article. All this would probably be clearer to the world if our magnificent neighbours ..."

August 11, 2018 8:10 pm

From lawrence on Why does anyone use Python?

"I should add, I feel that Python 1.x and 2.x added something to the world of technology. Early Python was both..."

August 11, 2018 10:44 am

From lawrence on Why does anyone use Python?

"Ryan, about this: " the default should be to not try to install packages system-wide". Agreed. I think that is..."

August 10, 2018 8:23 pm

From Ryan on Why does anyone use Python?

"I suspect your problem is that you missed the step in the instructions where it told you to run all those comm..."

August 5, 2018 4:41 pm

From Howard Ormsby on A developer asks for help, then gets angry at those who help them

"This one is very intense reading thank you..."

July 27, 2018 12:04 am

From Just An Observer on Why do women drop out of co-ed sports?

"Many coed leagues require a certain %age of women players, like volleyball 2 out of 5, in a lot of leagues. ..."

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>