There Is No Perfect Design

Many developers, especially those fresh out of college (though older developers are just as prone), fall into the trap of believing in an absolute concept of “the perfect design”. I hate to break such youthful idealism, but there’s just no such thing.

Design is always a series of trade-offs in an arduous struggle to implement the best solution given a set of competing constraints. And there are always constraints.

Not too long ago, I had an interesting discussion with a young developer who was unhappy with the design of a project he was working on. This project had a very aggressive schedule, and he complained about the poor design of the system.

“So why do you think it is poorly designed, the system appears to have met the requirements, especially given the short time constraint”, I asked him. He explained how he would have preferred a system that abstracted the data access via some form of Object Relational Mapping, rather than simply pulling data from the table and slapping that data on a page via data binding. He also would have liked to clean up the object model. It was’t in his mind, “good design”.

I pointed out that it also wouldn’t have been good design to spend time choosing and getting up to speed with an ORM tool, only to deliver the software late (which was not an option). Sure, the code would have been well factored, but we had a hard deadline, and missing it would have been a huge burden on the company.

I suggested to him that constraints are necessary for a software project. I told him,

If a project doesn’t have a time constraint, it will never get finished.

That lit a lightbulb for this developer.

That explains why I never finish my personal projects.

Absolutely! With no time constraint, this developer would spend more time after more time attempting to hit that elusive goal of the “perfect design”. But that goal will never be reached because perfect design is asymptotic. You can get infinitely close, but you can never reach it.

In the end, I told the developer that he’ll have the opportunity to refactor the code into a better design in the second phase of the project, as the time constraint is no longer so aggressive. I also suggested he skim Small Things Considered: Why There Is No Perfect Design by Henry Petroski. The book makes its main point in the first chapter, that design is about compromise and managing trade-offs to meet constraints. The rest of the book is a tour of various design decisions in history that illustrate this central theme.

[Listening to: Mono Culture / Free - Sasha and John Digweed - Northern Exposure: Expeditions (disc 1) (6:51)]

What others have said

Requesting Gravatar... Sharp as a Marble May 31, 2005 6:51 AM
# re: There Is No Perfect Design
GUILTY!!

At work, I often have a gun at the back of my head to get something completed. I miss deadlines occasionally due to trying to make something architecturally perfect.

Looking back on my ASP days, it's hard to accept that what I did was correct. Architecturally, it sucked, but it got the job done and in time. If a function is supposed to take in 2 integers and return the sum, it doesn't matter how it's done so long as the return value is correct. You can refactor it later after the deadline has passed.
Requesting Gravatar... Ken May 31, 2005 1:29 PM
# re: There Is No Perfect Design
I can totally agree, it is often very difficult to accept the fact that you have to create a balance between "perfect" design and getting a project done.

There are many times here at my job that I would love to be able and spend extra days on producing the perfect object model and database design to support that model, but the time just doesn't exist.

Although, I do think that the requirement of working at a acceptable speed with quality has caused me (over time mind you) to produce better code than I sometimes would if I spent many days working on a single component as opposed to hours. I do think every once in a while people overthink solutions in the pursuit of "perfection". Great Post, thanks for a good blog.
Requesting Gravatar... Rocky Moroe Jun 02, 2005 11:37 AM
# re: There Is No Perfect Design
This is one of the hardest lessons learned as a developer. Even for my own projects, it is hard to strip the "goal" project to a more simplistic model in order to get the core functional and add continue to develop in phases.

However, in this instance, I am not sure it would have taken much extra tiem to have a database layer and not tie the database to the UI. I personally, always at a minimum, build a simple database layer that consists of a "Data Manager" class that handles all communication with the database and use strong typed datasets as dataobjects for the UI. This little time, but still keeps the UI/Database seperated.

In VS2003, I would create a component class (as the manager class) and drop all my DataAdapters, Commands, Connection(s) on the component designer, and build that as a dll. That allows me to pull the strong typed datasets in as components in my ui and bind to them easily with the wizards and at the same time leaves my data layer modular.
Requesting Gravatar... max Feb 26, 2007 3:42 PM
# re: There Is No Perfect Design
hello! You right!
Requesting Gravatar... Community Blogs Dec 09, 2007 1:04 AM
# Extending ASP.NET MVC To Add Conventions
Note: If you hate reading and just want the code, it is at the bottom. Eons ago, I was a youngster living
Requesting Gravatar... you've been HAACKED Dec 11, 2007 2:11 AM
# Favor Composition over Inheritance and other Pithy Catch Phrases
Favor Composition over Inheritance and other Pithy Catch Phrases
Requesting Gravatar... M Dec 11, 2007 6:46 AM
# re: There Is No Perfect Design
It's not just the perfect design. Many people also fall into the trap in one (or more) of the following:

- Perfect OS
- Perfect language
- Perfect framework
- Perfect database
Requesting Gravatar... Matt Blodgett Dec 11, 2007 7:54 AM
# re: There Is No Perfect Design
"Perfect design is asymptotic." is one of the more profound things I've heard in a while. I won't forget that.
Requesting Gravatar... Matt Blodgett Dec 11, 2007 8:19 AM
# Perfect Design Is Asymptotic
Perfect Design Is Asymptotic
Requesting Gravatar... Pierre Chauvin Feb 26, 2008 5:49 AM
# re: There Is No Perfect Design
"because perfect design is asymptotic." a.k.a DesignAsRequirement antipattern ;-).
Requesting Gravatar... Umer Jun 02, 2008 10:40 PM
# re: There Is No Perfect Design
Trade-off's is what design is always about.

There should be tend towards making things according to Engineering principles and its an evolving process to IT professionals.
Evolve, Inovate and be different in the future OR Code to deliver always and belive that stone age is the best age and live happily there
Requesting Gravatar... Kamran Shahid Jul 14, 2008 12:10 AM
# re: There Is No Perfect Design
Nice Post,
100 % agreed

What do you have to say?

(will show your gravatar)
Please add 7 and 2 and type the answer here: