Phenomenal Software: The Internal Dimension: Part 2b: Patterns & Livingness

In this post I am going to review Alexander’s three aspects of patterns mentioned before, namely:

  • The Moral Component
  • Coherent Designs
  • Generative Process

I will show how they link to the following ideas:

  • Freedom
  • Cognitive Feeling
  • Livingness

The Moral Component & Freedom

20110916_1352_BuzzardThe moral aspect of patterns can be approached from any of a number of ‘paths up the mountain’. Certainly Alexander was concerned about whether buildings were ‘nurturing’ for us to live in, and so was thinking about more than utility. With computer systems and applications it is easier to think that this utilitarian aspect is all that exists. But there is an environmental part – an inner environment of thought, or ‘theory’ as Naur would say, whether we be users or developers.

If we think about how tools extend our own faculties, indeed our own being, the importance of the quality of this inner environment takes on a new meaning. The nature of the tool will affect how we form our ideas, which in turn will influence the form of our externally made world. Thus Alexander’s use of the word ‘nurturing’ and its applicability to software is not so out of place as it initially seems.

We can relate the ideas of utility, environment and hence morality by considering the concept of freedom – but defined in terms relevant to computer use. A computer system or application is a tool to get a particular task done. Good tools are ‘transparent’, meaning that you do not notice them when performing a particular task – they ‘disappear’ from your consciousness and leave you ‘free’ to focus upon the task in hand. It is in these terms that we can speak about freedom when using computers.

If you experience this ‘transparency’ when using a computer, I would consider that the software you are using contains this moral component that Alexander has defined. To paraphrase his words from the ‘Mirror of Self’ question:

“‘Moral’ Software gives you the freedom to develop a better picture of the whole of yourself, with all your hopes, fears, weaknesses, glory, absurdity, and which – as far as possible – includes everything that you could ever hope to be.”

What higher statement of purpose could we have for the programs we write? The current prevalent economic vision of the software industry pales into insignificance against such a statement.

We should not forget that this freedom to develop a ‘better picture of the whole of ourselves’ can be experienced by both users and developers. Indeed it is a central tenet of my whole ‘Phenomenal Software’ series that good software developers are implicitly on a path of self development, whether they are conscious of it or not.

Coherent Design & Cognitive Feeling

PetrelWingIn talking about coherent design we need to remember that Alexander is dealing with the external world of objects and a software designer/developer is dealing with non-physical artefacts – the building architect works in an external world, the software architect works in an internal world – though no less real in its effects.

If we consider programming as an ‘internal art’ we can see how it can be difficult to communicate effectively about the ideas that underpin our design and coding. Peter Naur wrote about the need to maintain a theory alive in the minds of the programmers if a system was to be properly extended or maintained. He also noted that the theoretical element could not be communicated accurately via written documentation or even the code itself – it needed human interaction with people holding the living theory of the software.

Reflecting on my own career I have come to realize that it is difficult to identify an abstract form of coherence or goodness for software separate from the context in which it is to be used. For instance some code that I had found to be elegant in the early days of computing, say using little memory and having few instructions, would not be a good solution to the same problem in a modern context. So here we can see the integration required between form and function; solution and problem context. They need to be in harmony: coherent form in design will have the moral component in its function and will mean that the theories and meaning formed by the developer or user will make sense and meet the ‘Mirror of the Self’ needs.

Most novices will work from a set of rules, one such example being to ‘Make it Work, Make it Right, Make it Fast’ in that order. This is a valid heuristic useful to stop programmers optimizing the code too early. However a rule-based approach has the danger of separating the stages into individual parts – which is not the best way to proceed in one’s thinking. This is the same tension as that between the TDD (Test Driven Development) folks and the design-up-front folks – a classic example of the need to work from an integrated view of the whole and the parts – i.e. respectively: making it right and making it work; design-driven and test-driven. In practice being done together.

So over my career I have developed a feeling for good design in the crucible of solving real-world problems. In actuality I cannot make it ‘Work’ until I have a sense of what is ‘Right’, even to a small degree. You can perhaps see that I have a personal preference towards the design view, though during my work I can easily fall into the trap of hitting the keyboard too early, something I have worked vigorously at controlling! As I gained experience I started to get this sense of the best way to structure the software, and in some cases – such as perhaps designing a media player – I might have a feeling for what is ‘Fast’ at an early stage, but this needs to be kept strongly in check against reality. Optimisation should be based upon measurement and human beings can be worse than random at predicting what needs optimising.

This sense for a good or coherent design is what I have called a ‘cognitive feeling’ in an earlier post, which is a very fine and delicate sensation indeed – it is not strong emotion. Over the years of my career I liken its development to the creation of a new sense organ, cognitive in its nature. It can be difficult to explain to less experienced practitioners due to the fact that the sense is likely to have been implicitly developed over the years. However it matches closely to the feelings that are evinced by Alexander’s ‘Mirror of the Self’ test so that frequently when talking to more experienced developers it will not be hard to get to a commonality in judgement.

This means that in order to create coherent designs we will need to develop this extra sense of a fine cognitive feeling. A quote from Alexander serves to give an idea of this feeling sense, and though dealing with external geometric entities, the same comments relate to software design when imagining how the structures will function:

“A pulsating, fluid, but nonetheless definite entity swims in your mind’s eye. It is a geometrical image, it is far more than the knowledge of the problem; it is the knowledge of the problem, coupled with the knowledge of the kinds of geometrics which will solve the problem, and coupled with the feeling which is created by that kind of geometry solving that problem.” A Timeless Way of Building, Chapter 9.

Generative Process & Living Structure

CloudTrailIn Alexander’s talk at the OOPSLA’96 conference in San Jose, he seemed somewhat bemused by the software domain’s use of patterns. On reading Alexander’s Nature of Order series we can perhaps see why. Some of the central ideas are those of ‘living structure’ and ‘structure preserving transformations’ which result in a ‘generative process’. How could these relate to software?

It is easier to understand the concept of structure preserving transformations when looking at how living things grow. As they grow and develop they need to continue living – we cannot just take them apart, do some modifications, and then re-assemble them! Every step of growth cannot disturb their livingness – thus EVERY change must preserve their living structure. The world of living things has no choice but to use a generative process if it is to stay alive.

At first glance this does not relate at all to the built world. When fixing my car in my younger days, there were times when bits of gearbox and engine were all over the floor! If the car had been a living being it would have been dead, but since it was not I of course was able to re-assemble it and make it work. Small software systems are similar. However, if you have ever worked on a sizable legacy system you will know that you need to spend a LOT of effort on NOT breaking the system. Any changes you make need to be closer to structure preserving, and any bad structures will need major surgery to improve. In reality you will not even try if it is not economically viable. Once you have bad structure, or use a ‘structure destroying transformation’ it is extremely difficult if not impossible to remedy:

“Good transformations do not cause any upheaval. So to get a good project, we merely have to make a sequence of structure-preserving transformations. When we do so, a good design evolves smoothly, almost automatically.
However, even a single bad transformation can upset the smooth unfolding. If we make one transformation which destroys structure, in the middle of a sequence of good ones, things become ugly very quickly;”
Nature of Order Book 2 p61. See also chapter 4.
I am not sure about the use of the word ‘merely’ in the above, since it understates the difficulty of identifying good transformations.

Also if we accept Naur’s Theory Building view and the idea of human mental schemas, this idea of a generative process makes more sense, since there is the living theory held by the programmers. If we then go further and connect to the phenomenological ideas of how we create meaning when we develop theories we can see that there is a justification for finding a livingness within the programming activity. Bortoft talks about the link between understanding and meaning which relates well to Naur’s ideas of theory building when understanding software. It also gives another dimension to the idea of livingness:

“understanding is the ‘concretion of meaning itself’, so that meaning comes into being in understanding.” Henri Bortoft in Taking Appearance Seriously p108

Just one final thought about the idea of livingness. Some might think that a running program would have a livingness, especially if it was a big system. I am not so sure and consider that it is WE who provide the livingness in the software domain. It is WE who create; experience design pain; judge. The computers are running a network of finalized thought constructs which is a different process to the thinking we do when defining those thought constructs. For me this perception of livingness in Alexander’s work and its relation to software is an ongoing work-in-progress.

I want to thank Jim Coplien for his help in pointing me at various ideas of Alexander that mesh with my work for this post.

In the next post I shall conclude this series of ‘Phenomenal Software’ by returning to the way philosophy has progressed forward from the Cartesian Subject/Object view. This will mean dealing with the thorny subject of subjectivity and of course you will have to decide if you can trust my judgements!

Thanks for reading.

Phenomenal Software: The Internal Dimension: Part 2a: Patterns & The Mirror of the Self.

When I started out programming the prevalent idea, which I shared at the time with many others, was that an artistic view was not going to be any part of the work. However, after a number of years in the business I began to come across moments of wonder when either I saw a great piece of coding or, very occasionally, managed to create something myself that hit the ‘sweet spot’. It was not until I happened upon Christopher Alexander’s work on patterns that I began to understand some of what was happening during these moments.

My introduction to the patterns movement occurred when reading the book Design Patterns written by the “Gang of Four”: Gamma, Helm, Johnson & Vlissides, this becoming a standard reference text. In trying to better understand the patterns vision I read some of Richard Gabriel who has some interesting ideas about the relationship between art and software. He has even come up with the idea of a Masters in Fine Arts in Software.

In Alexander’s earlier architectural patterns book he defines a library of external geometric entities to be used as design guidelines for buildings, for example: an alcove for chats that is separated off from a corridor. It is in his later masterwork: The Nature of Order that he describes his underlying ideas about ‘living structure’ and his thoughts about the perception of ‘goodness’ in design.

Alexander does not shy away from the moral dimension of his work. In a keynote speech he gave to the OOPSLA’96 conference in San Jose he stated that:

“One of the things we looked for was a profound impact on human life. We were able to judge patterns, and tried to judge them, according to the extent that when present in the environment we were confident that they really do make people more whole in themselves.” OOPSLA’96 keynote.

And later in the same talk:

“The pattern language that we began creating in the 1970s had other essential features. First, it has a moral component. Second, it has the aim of creating coherence, morphological coherence in the things which are made with it. And third, it is generative: it allows people to create coherence, morally sound objects, and encourages and enables this process because of its emphasis on the coherence of the created whole.” OOPSLA’96 keynote.

But how can we judge what is coherent? To understand Alexander’s approach we have to read the first book of ‘The Nature of Order’ series where he describes the ‘The Mirror of the Self’ test.

The Mirror of the Self

To develop this judgement of coherent living structure, Alexander identifies what he calls the ‘Mirror of the Self’ test. He highlights that there is a difference between what he calls ‘apparent liking’ and ‘true liking’. For example, when deciding which of two objects are liked the best, rather than accepting a quick ‘apparently liked’ judgement he asks for a ‘truly liked’ judgement:

“…which of the two objects seems like a better picture of all of you, the whole of you: a picture which shows you as you are, with all your hopes, fears, weaknesses, glory and absurdity, and which – as far as possible – includes everything that you could ever hope to be. In other words, which comes closer to being a true picture of you in all your weakness and humanity;…” Nature of Order: Book 1. p317.

Using this idea he has found that it is possible to have a high level of agreement (80-90%) between people when using their judgment to identify living structure for objects. So it seems that how we phrase the question is all important.

A Reappraisal of the Software Patterns Movement

So far the software patterns movement has tried to abstract out particular solution patterns to be used as guidelines when designing software structures. Despite the best intentions it has degenerated into being a set of document templates, rather than embodying the wider view of Alexander’s work. Once again we have become hooked on a results-oriented view of the world as if we can only feel comfortable with this approach in such a technical domain.

Erich Gamma, one of the co-authors of the Design Patterns book, said that referring to patterns is most useful when we already have a specific design ‘pain’ rather than trying to force patterns onto a particular project from the outset. This points to the fact that we cannot get away from being conscious of how we develop our judgement. How do we even identify that we have a design ’pain’ if not through discerning human judgement and a sense of rightness?

Along with other commentators like Jim Coplien, I consider that Alexander’s vision of patterns (the drive towards living structure and the big question of making human life more whole) has not been truly realized within the software discipline. We need to revisit the Alexandrian roots of the patterns movement and understand how these roots relate to software development.

In Alexander’s OOPSLA’96 talk he identified 3 key points in his vision for the patterns work: a moral component; coherent designs; generative process. Although there has been some discussion in the software community about Alexander’s later work, it is fair to say that it has been difficult to take these ideas further in the domain. However I have found that by connecting the ideas with those prompted by reading Bortoft and early Steiner we can get a bit more clarification which I will report on in my next post.

Thanks for reading so far and I wish you all the very best for 2014…

Phenomenal Software: The Internal Dimension: Part 1: Theory Building

Introduction

DiscusPanelIt is a while since I last posted because I was hoping to produce a concise single post to deal with the issues of how a phenomenological approach to software relates to the issues of Patterns and Living Structure that Christopher Alexander has worked on. So much for hopes. As I started (re-)reading more around the subject, it opened up before me, as one might expect I guess. So I am breaking it down into smaller sections and giving it the subtitle “The Internal Dimension”.

In these “Internal Dimension” posts I am going to deal with the issue of meaning and structure in software, starting with the seminal paper by Peter Naur in 1985 and moving on to the patterns work of Christopher Alexander. I will be informing it with the ideas from an essay by Hans-Georg Gadamer with the great title ‘The Relevance of the Beautiful’ and more recent writing by Wyssusek. Wyssusek also notes how many of these ideas are relevant to users, rather than just the application developers.

The Internal Dimension Part 1: Theory Building & The Generation of Meaning

Back in 1985 Peter Naur, one of the co-creators of the ALGOL60 programming language, wrote an essay entitled “Programming as Theory Building”. This has become a seminal paper highlighting, as it did, that programming was more than just producing the program and its accompanying documentation.

He identified that when handing over a piece of software to other people to maintain and/or extend, it was not enough to just supply the source code and a full set of documentation. You needed to allow access to the original authors of the program because it was they who held the live ‘Theory’ of the program and could ensure that future work maintained a consistent program architecture.

“A main claim of the Theory Building View of programming is that an essential part of any program, the theory of it, is something that could not conceivably be expressed, but is inextricably bound to human beings.”

Indeed the “conceivable expression” will be the code itself plus any documentation. But these are not enough for a working understanding of the system.

Anyone who has tried to understand other people’s programs – something I seem to have been doing for most of my career – will relate to Naur’s thesis. We cannot look on the ‘Theory’ as being an abstract thing and it cannot be put down as a set of rules – by definition the rules are actually within the software. This fallacy of the ‘abstract theory’ also highlights a problem in devising a method for building theories. Naur seems to be very much in tune with the phenomenological idea of the whole:

“In building the theory there can be no particular sequence of actions, for the reason that a theory held by a person has no inherent division into parts and no inherent ordering. Rather, the person possessing a theory will be able to produce presentations of various sorts on the basis of it, in response to questions or demands.”

We can now see that the theory does not so much represent an abstract piece of knowledge to be put forth, but rather a new skill of the person – an ability to respond appropriately to the demands of unknown situations. It is here that we have the link to meaning – the realm of hermeneutics.

Understanding a piece of software is about trying to grasp what the original programmer meant when s/he created the various data structures and functions of the system. It is at this point that the phenomenological approach to the generation of meaning changes the whole view of programming as theory building. The meaning is a live thing which is “inextricably bound to human beings.”, and on a working system the team of programmers is continually creating and re-creating a shared meaning about it. As Wyssusek noted “if this practice is interrupted the system ‘dies’.” Naur’s original words describing this phenomenon were:

“…one might extend the notion of program building by notions of program life, death, and revival. The building of the program is the same as the building of the theory of it by and in the team of programmers. During the program life a programmer team possessing its theory remains in active control of the program, and in particular retains control over all modifications. The death of a program happens when the programmer team possessing its theory is dissolved. A dead program may continue to be used for execution in a computer and to produce useful results. The actual state of death becomes visible when demands for modifications of the program cannot be intelligently answered. Revival of a program is the rebuilding of its theory by a new programmer team.”

This is an important point to understand because it requires that developers and their management give credence to the living internal dimension of programming. While the domain fails to adequately grasp this dimension and how it can be informed by a phenomenological approach (see Simon & Maria Robinson’s great ideas of ‘Holonomics’) there will continue to be embarrassing and expensive project failures.

References

  1. Alexander. “A Pattern Language.” 1997.
  2. Gadamer. “The Relevance of the Beautiful and Other Essays.” Cambridge University Press, 1986.
  3. Naur. “Programming as Theory Building.” 1985.
  4. Wyssusek “A philosophical re-appraisal of Peter Naur’s notion of “programming as theory building”. Proceedings ECIS2007.

In the next post I will describe how I see the links with Christopher Alexander’s patterns work.
Until then…