Indeed! What shall we make of this work? Coming originally from
a traditional computing science background, I share your pain.
> [..] Knowing nothing about psychology I did not feel
> confident to challenge
> them. Then I discovered "The psychological study of programming" by B.A.
> Sheil, Computing
> Surveys Vol 13, No 1, March 1981. I agreed with everything he said. A lot
> of the research
> up until 1981 was not scientific at all and the result bogus.
>
> So where are we today, 20 years later?
>
> I cannot find any research that suggests leaps in understanding of the
> practicalities of
> programming. Have people given up on this kind of research because it is
> to hard and expensive
> to do?
Sheil's main argument in that paper was that we had to start
understanding what goes on inside the head of the programmer more.
In other words, don't just test one construct against another and
leave the programmer as a black box. Open up that black box and
see what goes on so that you can understand the results you're
getting. From my reading it appears that the early 1980s marked
a transition point when simple comparison studies were being
phased out and more cognitive-oriented studies started to take
place (see e.g. Curtis' article in the "Handbook of Human-Computer
Interaction", ISBN 0-444-70536-6). About the same time we started
to get a little more concerned about the task too (see e.g. Green's
chapters in "Psychology of Programming" ISBN 0-12-350772-3) since
the appropriateness of any construct will depend upon what it is
being used for.
This advice to more seriously consider the user and task is, I think,
very good and I think doing so is important to rendering our results
more scientific. Unfortunately, it seems less and less of the
resulting work is directly relevant to the relatively low-level
practices of coding by experts.
> Are coding guidelines doomed to be continued to be created by old farts
> sitting in meetings telling
> everybody what they used to do in the old days and that todays programmers
> don't know
> how to write software?
In my opinion, yes. I don't know of anybody willing to go through
all the lists of coding guidelines and subjecting them to empirical
test (Dr. Gould? Where are you?). On the other hand, some authors
of guidelines (hint, hint) might in the future wonder about whether
including a cognitive psychologist as a co-author might be a useful
endeavour.
> Is there no scientific basis for how programmers
> should write their software?
> It is generally agreed that coding guidelines do need to be free from
> interpretation. [..]
Maybe some people on this list will submit relevant research.
But I think the answer you seek is that we know too little to
make many specific recommendations. At least, not enough to
make money teaching evening courses to professional programmers.
I think also it is a little unfair to ask psychology to be
able to unambiguously determine the "right" things to do. What
is best will normally depend on any number of ad hoc and
contingent factors. That's why expert interpretation is needed.
The great thing about rules is there's always an exception.
How many rules do you think govern programming? How many exceptions
to these rules? How do good programmers know when to apply them?
The answer: years of experience. I don't think you'll be able
to write any reasonably length book that captures all of this
hard-earned wisdom. The implication would be that becoming a
good programmer is something that can be done in a matter of
days or weeks. Guidelines can be thought of as the rules of thumb
that are applicable widely enough to be worth writing down and
teaching. But good luck writing down the exceptions (and don't
blame psychology if you have trouble).
So doing some empirical work on one's guidelines seems like
a good start to being scientific. At least then you might find
out more accurately when the guideline is reasonable. But it
seems to me most likely that each good experiment will raise a
host of questions that ask about the specific context of use
for each guideline.
> Should I ignore cognitive psychology and go back to impressing people with
> my experience
> and looking impressive as I tell them that I know what I am doing?
> derek[..]
Yes, with one small caveat. At any point a practical discipline
like software development will retain a large craft element even if
they strive to be an engineering discipline with a strong explicit
science basis (see chapter 5 of Simon's "Sciences of the Artificial",
ISBN 0-262-69191-4). Software development is far more of a craft
than an engineering discipline right now (but I'm sure there's lots
of people that would want to disagree with that statement).
But being a craft discipline is not completely shameful! Craft
disciplines get a lot of things right before they can be explained
scientifically. Bridges were successfully built before static
mechanics were understood or gravity explained. So my advice is
to summon up as much experience as you can and be wise in your
exposition. Nobody else, I think, can do much better right now.
The caveat I promised is that we all should still be interested
in long-term research establishing a scientific foundation. Keep
an eye out and use whatever you can to your best judgment. Try
to impress with your experience because experience is valuable,
but be sure to bemoan the lack of a satisfactory scientific
basis.
Andrew