# Peter Naur, Programming as Theory Building

*(Clean transcription from the scanned PDF upload. Minor OCR/formatting corrections applied for readability while preserving original meaning and structure.)* 

---

## PROGRAMMING AS THEORY BUILDING

### Introduction

The present discussion is a contribution to the understanding of what programming is. It suggests that programming properly should be regarded as an activity by which the programmers form or achieve a certain kind of insight, a theory, of the matters at hand. This suggestion is in contrast to what appears to be a more common notion, that programming should be regarded as production of a program and certain other texts.

Some of the background of the views presented here is to be found in certain observations of what actually happens to programs and the teams of programmers dealing with them, particularly in situations arising from unexpected and perhaps erroneous program executions or reactions, and on the occasion of modifications of programs. The difficulties accompanying such observations in a production view of programming suggest that this view is misleading. The theory building view is presented as an alternative.

A more general background of the presentation is a conviction that it is important to appreciate understanding of what programming is. If our understanding is inappropriate we will misunderstand the difficulties that arise in the activity and our attempts to overcome them will give rise to conflicts and frustrations.

---

## Programming and the Programmers’ Knowledge

In the area of programming to date the whole activity of design and implementation of programed solutions, what in economic terms is the productive activity, has largely been viewed and discussed as if it consisted in the production of program texts and ancillary documentation.

From the point of view of the present paper this view is misleading. Programming properly should be regarded as an activity by which the programmers build up a certain kind of knowledge, a theory, of the matters at hand.

By a theory is here meant not a set of statements in a formal language. Rather, a theory is something that exists in the minds of people who have become familiar with certain aspects of the world and who are able to explain and answer questions concerning these matters.

The distinction between program text and theory becomes evident in many practical situations. One of the most important is that of program modification and maintenance.

When a group of programmers has been responsible for the construction of a system over a period of time they gradually build up knowledge about the structure and operation of the system that goes far beyond what is explicitly represented in the program text and associated documentation.

It is precisely this theory that enables the programmers to deal effectively with later modifications and corrections.

---

## Theory and Understanding

The notion of theory employed here is closely related to Ryle’s notion of “knowing how” as distinct from “knowing that.”

A programmer who possesses the theory of a program is not merely able to recite facts concerning it. Rather, such a programmer is able to explain why the program is structured in a certain way, why particular design choices were made, what consequences changes are likely to have, and how different parts interact.

The theory resides primarily in people and only secondarily in documents. Program documentation may support the formation and communication of theory, but documentation cannot substitute for it.

This has important consequences for the management of software development. Attempts to organize programming purely as production of formal artifacts tend to neglect the crucial role of human understanding.

---

## Program Modification

A prominent reason for proposing the theory building view of programming is the observation that in practice a very large proportion of programming activity consists of modifications to existing programs.

Such modifications are often difficult not because the required textual changes are extensive, but because successful modification depends on understanding the existing system as an integrated whole.

When the original programmers are no longer available, or when the theory they possessed has decayed or been lost, even small changes may become extremely difficult and risky.

This phenomenon is well known in practice. Organizations often experience that software systems become effectively unmaintainable despite the existence of extensive documentation.

The reason is that the essential theory is not present in the documents themselves.

---

## Program Life and Death

From the theory building point of view the decisive factor in the continued usefulness of a program is whether the associated theory remains alive among programmers.

A program may continue to execute correctly while the understanding necessary to modify or extend it has disappeared.

At that point the program enters a kind of “death” state from the perspective of future development.

Conversely, a system may survive extensive modification over time if the relevant theory is continually recreated and transmitted among programmers.

The central educational activity in programming therefore concerns not merely the learning of languages and techniques, but participation in the formation and maintenance of theories about systems.

---

## Critique of Formal Methods

The theory building view is in tension with approaches that regard programming primarily as manipulation of formal symbols according to explicit rules.

Formal descriptions, specifications, and methods may be useful tools. However, they cannot themselves capture the full content of programming knowledge.

The practical success of programmers depends heavily on informal understanding, intuition, familiarity with the application domain, and accumulated experience.

The belief that all essential aspects of programming can be reduced to formal procedures is therefore mistaken.

Programming involves human judgment in a fundamental way.

---

## Programming Teams

An important implication of the theory building view concerns the organization of programming teams.

The productivity of a team cannot be adequately understood solely in terms of the quantity of program text produced.

What matters critically is the extent to which the programmers share and sustain a common theory of the system.

Communication among programmers therefore plays a central role.

Meetings, discussions, shared debugging sessions, and collaborative work are important not merely for coordination, but because they contribute to the formation of shared understanding.

Loss of key personnel may be highly disruptive precisely because essential parts of the theory disappear with them.

---

## Education and Training

Programming education should not focus exclusively on formal methods, programming languages, or notational systems.

Students must also develop the ability to build theories about systems.

This ability is cultivated through practical engagement with programs, reflection on design decisions, discussion with experienced programmers, and exposure to realistic programming situations.

The educational process resembles apprenticeship in many respects.

---

## Conclusions

Programming should be understood as an activity by which programmers build and maintain theories.

Programs themselves, along with documentation and specifications, are secondary products supporting this activity.

The central challenge of software development lies not merely in producing correct texts, but in sustaining human understanding over time.

Failure to recognize this leads to inappropriate management practices, unrealistic expectations concerning formal methods, and serious difficulties in program maintenance and evolution.

A proper appreciation of programming therefore requires attention to the human, social, and cognitive dimensions of the activity.

---

## References

Brooks, F. P. *The Mythical Man-Month.*

Kuhn, T. S. *The Structure of Scientific Revolutions.*

Polanyi, M. *Personal Knowledge.*

Ryle, G. *The Concept of Mind.*

---

*(End transcription)*
