Who Builds a House
Finding a better solution by thinking about the problem
and its solution, rather than just thinking about the code.
something, we can explain it clearly in
writing. If we have not explained it in
writing, then we do not know if we really understand it.
The second observation is that to
write a good program, we need to think
above the code level. Programmers
Architects draw detailed plans
before a brick is laid or a nail is ham-
mered. But few programmers write
even a rough sketch of what their pro-
grams will do before they start coding.
We can learn from architects.
A blueprint for a program is called a
specification. An architect’s blueprint is
a useful metaphor for a software specification. For example, it reveals the fallacy in the argument that specifications
are useless because you cannot generate code from them. Architects find
blueprints to be useful even though
buildings cannot be automatically generated from them. However, metaphors
can be misleading, and I do not claim
that we should write specifications just
because architects draw blueprints.
The need for specifications follows
from two observations. The first is that
it is a good idea to think about what we
are going to do before doing it, and as
the cartoonist Guindon wrote: “Writ-
ing is nature’s way of letting you know
how sloppy your thinking is.”
We think in order to understand
what we are doing. If we understand