

An Under-Appreciated Fact: We Don't Know How We Program - paulajohnson
http://paulspontifications.blogspot.com/2008/05/under-appreciated-fact-we-dont-know-how.html

======
donw
I think he needs to read 'Zen and the Art of Motorcycle Maintenance'.
Programming, like architecture, medicine, or sculpture, is an art. Those at
the bottom of the profession see only the mechanical process of churning out
code, drawing a room, prescribing medication, and making a pot from clay.

Those at the top are, for lack of a better term, at one with their profession,
and programming is certainly no different. A good programmer can feel, in a
very visceral way, the difference between good and bad code, in the same way
that the average person can feel the difference between Michelangelo and
street graffiti. I consider myself to be only a very mediocre coder, and yet
every now and then, I see a program that is just... beautiful. Aesthetically
pleasing. And I couldn't tell you why.

Things like that can't be diagramed or taught; it's up to the individual to
grow that seed of what Pirsig calls 'Quality' within themselves.

~~~
run4yourlives
You should add music as a comparison, since I think most people seem to be
able to relate much better to it than say, sculpture. It may help with the
analogy a little.

------
gibsonf1
You mention a well-know process for designing a house. There is none that I
know of, other than the word "design".

My approach is to consciously absorb as much of the problem at hand as
possible, then let my subconscious crunch on it for a while, the length of
time depending on the complexity of the problem. Coming up with the big
concept for a large design, both building or software, can take a few days if
its revolutionary, or a few minutes if its not. The key is to have a process
that helps you leverage the power of your subconscious. Trying to force a
solution in your conscious mind on a harder problem can be both painful and a
waste of time.

~~~
paulajohnson
How much original thought is going into the floor plan of the next McMansion
to be built? Or the next 3-storey steel-framed office block? Are these truly
developed from scratch by deeply original thought every time? I admit I have
no experience of the building industry, but I seriously doubt it. I believe
they are created by following standard recipes and checklists (square feet per
desk, maximum distance to restrooms, maximum distance to window). I work on a
business park full of 3 storey office blocks. They are all minor variations on
the same theme. I live in a housing estate where all the houses are also minor
variations on the same theme. Thats what I'm talking about. Maybe architects
don't design these buildings. Maybe I'm talking about a more junior part of
the construction industry. Either way, it completely lacks any originality.

~~~
scott_s
I think there are software analogs of your office park.

You hit on a good insight in the essay: we don't know how we program. But I
think you incorrectly assumed that this is unique to software development.
Instead, I think it's an inherent part of any job that requires problem
solving.

------
sah
_Think about other important areas of human endeavor: driving a car, flying a
plane, running a company, designing a house, teaching a child, curing a
disease, selling insurance, fighting a lawsuit._

 _driving a car, flying a plane_ : These are extremely poorly understood
tasks, but fortunately parts of the average human brain are pretty good at
things like that.

 _running a company_ : Smart people fail at this all time.

 _teaching a child_ : Why are so many people unable to remember the math they
learned in grade school? Why are we engaged in a public debate about the value
of teaching to standardized tests instead of some less well-defined but
apparently better approach?

 _curing a disease_ : Come on, new methods and approaches are constantly being
invented in medicine! We have no general way of doing this.

~~~
run4yourlives
>Why are so many people unable to remember the math they learned in grade
school?

You mean like 2+2 or 9x5? Most people forget the advanced math that they learn
in high-school, but the basic stuff is pretty well ingrained into the average
subject, accounting for variations, of course.

------
bridgetroll
From the article, I recognize that the author is differentiating programming,
that is to me "coding" from all the other activities in the software
development lifecycle, as he mentions in his third paragraph. I assume that
many of you also recognize this, but that some might not. I bring this up
because in replying back to the point of the article and whether or not we
"know how we program" it is important to define what we mean by programming
and what boundaries we place in the activity "programming" which is different
than the activity "design" or the activity "testing."

------
jamess
This isn't really true for all software development. If you write a detailed
design, the process for writing the software is as simple as "write what the
design says you should write, then test it conforms" It's only true for the
sort of software development where you design while you write, AKA hacking.

I'm not against hacking per se. I'm doing it right now. But to take it as the
de facto way the software industry functions is wrong. Hacking has certain
problems, like unanticipated problems tend to stall the process (My own recent
encounter had me blocked for three days, trying to think of an adequate
solution to the problem of how authentication should work in an environment
where HTTP servers and clients are essentially "decoupled", that is a solution
to the problem of where presentation and application data are coming from two
different sources, how does the data provider verify the presentation logic is
trustworthy? It's a hard problem to which I have only a partially satisfactory
answer... but I digress.)

The process for writing code tends to be unwritten, simply because in the best
case it is so trivial that writing it is an insult to the reader. I guess the
industry's collective problem is that the best case happens so seldom.

~~~
Retric
You’re making a basic assumption that your design has sufficient detail to
produce the program. The problem with this idea is your moving programming to
the design phase (using pseudo code) but you’re not eliminating the act of
programming.

AKA, I need a function called add that adds each element in an array and
returns the result.

Now what data type is in that array? What should you return if the array is
empty or null? etc.

~~~
mrtron
The design phase is like map making. You can't make a completely accurate map
at any scale, or that map would be the size of what it represents.

So, you can't make a design doc detailed enough to make the programmer make
zero decisions, or you could just compile that design doc.

------
watmough
Yes we do.

Perhaps not all schools teach it this way, but my computer science education
included a semester of lectures that started us off in the process of Stepwise
Refinement.

In S.R. you start with a goal and progressively, or step-wise, refine it until
you are at a level in which it is obvious what code should be written, whether
it be an assignment, expression, loop, functional call etc.

I believe S.R. dates from Dijkstra and the Algol-W period.

------
tyn
It seems to me that you ignore creativity. You don't want to put this in a
process.

------
goodkarma
>> The fact is this: there is no process for programming.

I disagree. There is a process, but it is so basic we may not realize it:

1\. identify the big problem

2\. break it down into smaller problems

3\. solve the smaller problems

4\. repeat as needed

~~~
run4yourlives
Step 3 though has no process, hence, the entire function has no process. (None
that can be useful at least.)

Your process is so vague, it's like saying the process to get from Seattle to
Hawaii is:

1\. Leave Seattle.

2\. Travel.

2\. Arrive in Hawaii

------
mynameishere
The completely described process for buttering bread is of sufficient
complexity that we should never attempt to make a process for developing
software. Unless you keep it simple:

Step one: Look medusa in the face.

------
athloi
Any really good skill is completely organic this way. Your brain fuses a whole
bunch of thoughts, instead of producing just one that you can put into words,
and you just do it.

That's the fun part.

------
izaidi
This is basically right but you're wrong in distinguishing programming from
other design tasks. There's never a "process" for design; there's only the
meta-process of creativity.

