Friday, September 20, 2013

Faith, Creation, and Programming

As a programmer, my greatest creative outlet is writing code. While deep inside a interconnected web of bits and logic hunting down that perpetual last bug can seem to someone from the outside to be anything but creative, there is a unique type of creativity that is found in writing software. This type of creation is beautifully described in one of my favorite quotes from Fredrick P. Brooks, Jr’s book The Mythical Man Month. It lists several reasons why programming is joyful:

Fredrick P. Brooks
Why is programming fun? What delights may its practitioner expect as his reward?

First is the sheer joy of making things. As the child dlights in his mud pie, so the adult enjoys building things, especially things of his own design. I think this delight must be an image of God’s delight in making things, a delight shown in the distinctness and newness of each leaf and each snowflake.

Second is the pleasure of making things that are useful to other people. Deep within, we want others to use our work and to find it helpful. In this respect the programming system is not essentially different from the child’s first clay pencil holder “for Daddy’s office”.

Third is the fascination of fashioning complex puzzle-like objects of interlocking moving parts and watching them work in subtle cycles, playing out the consequences of principles built in from the beginning. The programmed computer has all the fascination of the pinball machine or the jukebox mechanism, carried to the ultimate.

Fourth is the joy of always learning, which springs from the non repeating nature of the task. In one way or another the problem is ever new, and its solver learns something: sometimes practical, sometimes theoretical, and sometimes both.

Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.

Yet the program construct, unlike the poet’s words, is real in the sense that it moves and works, producing visible outputs separate from the construct itself. It prints results, draws pictures, produces sounds, moves arms. The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be.

Programming then is fun because it gratifies creative longings built deep within us and delights sensibilities we have in common with all men.

Put in a spiritual context, these reasons can be restated as the following:

  1. The joy of creation
  2. The joy of service
  3. The joy of seeing your creation in action
  4. The joy of learning
  5. The joy of having free and limitless creative medium

Brooks goes on to expand on the “creative longings built deep within us.” Citing Dorothy Sayers’ book The Mind of the Maker, he recognizes creativity as having three separate stages:
  1. The idea
  2. The implementation
  3. The interaction

Expanding on this, Brooks writes:

A book, then, or a computer, or a program comes into existence first as an ideal construct, built outside time and space, but complete in the mind of the author. It is realized in time and space, by pen, ink, and paper, or by wire, silicon, and ferrite. The creation is complete when someone reads the book, uses the computer, or runs the program, thereby interacting with the mind of the maker.

This description, which Miss Sayers uses to illuminate not only human creative activity but also the Christian doctrine of the Trinity, will help us in our present task.

To restate this description in the spiritual context of creation:

This world, then, came into existence first as an ideal construct*, built outside time and space spiritually (Moses 3:5; D&C 29:34), but complete in the mind of the author (Abr. 2:8). It was realized in time and space (Alma 40:8), using the elements that now surround us (Abr. 3:24). Finally, God did not consider His creation complete until someone (man) was placed on this world to interact with it and thus His mind and will (Abr. 3:24; Moses 2:26; Alma 30:44).

* – "The head God called together the Gods and sat in grand council to bring forth the world. The grand councilors sat at the head in yonder heavens and contemplated the creation of the worlds which were created at the time." (from Teachings of the Prophet Joseph Smith p. 348)

Dieter F. Uchtdorf spoke on this aspect of creation in his talk titled, "Happiness, Your Heritage" in the General Relief Society Meeting in October 2008:
Creation brings deep satisfaction and fulfillment. We develop ourselves and others when we take unorganized matter into our hands and mold it into something of beauty. …

The more you trust and rely upon the Spirit, the greater your capacity to create. That is your opportunity in this life and your destiny in the life to come.

It is interesting how closely intertwined joy and the creative process are. If celestial, or God’s, joy is in His creations (D&C 59:18-20) it is of no wonder our spirits become joyous as we participate in the creative process. The child’s mud pie, the poem, the sonnet, the musical score, the mathematical construct, the painting, the program, and the ultimate creation of another human body; all give us a glimpse into the eternal nature of the creation. The joy of creation carries with it a glimpse of our infinite potential.

clock.c from the Linux Kernel
What is particularly interesting about programming is that the creative process occurs in the abstract only. Yes, the program is stored on disk in the form of magnetic variations, but even this is invisible to the human eye and is not the purpose for which the program is created. A program is not the series of characters typed by the programmer. Rather the substance of a program is thought itself, concept described. Working this close to raw thought not just at the beginning of the creative process but all throughout the program’s creation requires a high level of concentration and mental exertion but likewise delivers a high level of satisfaction and joy.

While the details of exactly what 'spiritual creation' is may be unclear, this process of creating implementable concepts and structures mentally surely must play a pivotal role. Thus, as we practice and participate in the process of creation and exercise our faculties (mental, physical, and spiritual), we draw nearer to God and learn more about the nature of eternity. This is why programming is, and many other creative processes are, so joyful. The creative process is itself a symbol of Eternity.