Showing posts with label logic. Show all posts
Showing posts with label logic. Show all posts

Tuesday, 13 November 2012

The Spirituality of Computer Programming

About 18 years ago I had an unusual experience.  I found myself crying - albeit fairly briefly - over a few lines of a small computer program.  I am not referring though, to cries of frustration in response to a particularly badly written piece of code.  I can't remember what the code was now, or even whether it was mine or somebody else's.  I seem to remember (although I'm not certain) that it was written in a language called Lisp.

In the Christian circles that I've found myself involved with over the last few years, there has been a lot of talk about the "sacred/secular divide".  This has to do with the fact that - particularly in Evangelical churches but probably in other Christian traditions as well - some parts of life are often treated - explicitly or implicitly - as more "holy" or "spiritual" than others.

So for example, going to Church, reading the Bible, or working for churches, charities or missionary organisations is often considered more worthwhile or significant than cleaning your teeth, watching television, being a good primary school teacher, or - indeed - writing computer programs!

This seems to be a little at odds with the Bible itself.  For example, Psalm 24 verse 1:
The earth is the Lord's and everything in it, the world and all who live in it.
Or  Colossians 3 verses 23-24:
Whatever you do, work at it with all your heart, as working for the Lord, not for human masters, since you know that you will receive an inheritance from the Lord as a reward.
Or Philippians 4 verse 8:
Finally, brothers and sisters, whatever is true, whatever is noble, whatever is right, whatever is pure, whatever is lovely, whatever is admirable—if anything is excellent or praiseworthy—think about such things.
As well as being contradictory to the Bible, this artificial sacred/secular split also goes against common sense.   If God made the whole of the created order, including human beings with their skills, tastes and ingenuity, then it makes sense that the whole of life would be important to Him.  And if it's important to Him then it should also be important to me.

So - getting back to my original subject - what does God have to say about computer programming...?  I have to admit that the Bible is a little sketchy on this topic!  I'm not sure exactly why I got so tearful all those years ago over those few lines of computer code, but I was praying at the time and I did feel genuinely moved, and felt that God was moved by what I was seeing.

The best way I can think to make sense of this is that computing is a small but very significant part of mankind's technological development, and that technology was always part of God's intention for us.  It springs out of our God-given ingenuity, curiosity and creativity and is part of our call to rule over creation and fulfil it's potential.  It is up to us of course, whether we use these God-given skills wisely or not and ultimately, whether creation suffers or benefits from our stewardship.  God cares that we have these skills though, and He cares deeply about how we use and develop them, and what we do with them.

I have always felt passionate about computer programming - although I also feel slightly embarrassed to admit this "in print"!  I have a very logical mind, but I also have a fairly strong creative streak.  The existence of computers gives me a unique opportunity to combine these 2 things.  Because of computing, I can create something, purely out of logic, with no physical form, which nevertheless still somehow exists in a very precise and clearly defined way, is unique to me, and has an obvious and measurable impact on the real world!  Just a few decades ago, such a thing would have been completely unheard of.  I often feel as though I was born for such a time as this!

As well as having a practical use though, computer programs have something else that is common to anything we create, but which most non-programmers (and even some programmers) might be surprised by.  Computer programs have - or at least can have - beauty!  (the flip-side to this of course, is that they can be extremely ugly as well!).  I'm not just talking about the beauty of a well-designed web page or graphical user interface - although that's part of it of course - I'm talking about the code itself!

Computer code consists of logical solutions to problems.  But there are almost always a near infinite number of ways that any particular problem can be solved.  There are complicated ways and easy ways.  There are ugly ways - and yes, beautiful ways!  The word "beauty" isn't used that often by computer programmers when they talk about their code - instead the word "elegance" tends to be preferred instead.  An elegant piece of code is one that does what it's intended to do clearly, succinctly and efficiently and is - ideally - easy for others to understand and maintain.  But it has an aesthetic as well as a functional quality - it is pleasing to the developer, and to any other developer who sees it and has an eye for that sort of thing.

I have to admit that I sometimes struggle with the fact that I put so much effort into creating  beautiful things that are so rarely and seldom appreciated - or even understood!  Sure, users appreciate the outward form of my programs and are pleased with what they do (assuming I've done a good job) but hardly anyone fully appreciates what goes on underneath.  If I'm working as part of a team, which has a good quality control process in place, then parts of my code will be checked by other programmers occasionally to make sure I'm not doing anything stupid, but that's not quite the same thing.  Just occasionally I get to share my work with another programmer, who might be impressed by it, or a programmer who happens to read my code might appreciate what I've done and even mention it, but this is quite a rare thing.

It strikes me that a lot of creation itself seems to be like this.  Beauty is everywhere in all sorts of unexpected and inaccessible places and we continually seem to be discovering more of it.  It's almost like God didn't care that most of it would never be seen - although I'm sure He also delights in our continuing discovery of it.  It seems to me though, that God delights in beauty for its own sake - although, like my computer programs, most of it seems to have a functional purpose as well.  It's part of His creative nature, His joy, His exuberance.  He doesn't just create to perform a task, or for the sake of it.  Beauty, infuses everything He makes.
God saw all that he had made, and it was very good. And there was evening, and there was morning—the sixth day.     (Genesis 1 verse 31)

Sunday, 9 September 2012

Don't Let Your Understanding Get in the Way of Your Understanding

Christianity is for stupid people!

By that of course I mean that Christianity is for everyone, regardless of intellectual capacity.

As a moderately intellectual person myself though, I like to ask lots of questions and try very hard to reason things through. I have a high degree of confidence in my own reasoning skills which can cause me significant difficulties when I'm confronted by something I can't understand. This can make being a Christian quite difficult - because when it comes down to it I don't really understand my own faith! I like to pretend that I do and I can usually talk fairly intelligently about it in a way that sounds quite convincing to other people (or at least to some other people anyway!), but I always have a lot of questions in my own mind - sometimes nearer the surface than others - which I am not able to answer.

I have often noticed that happiness and/or goodness do not seem to correlate - at least not positively - with intellectual capacity. In fact, if a correlation was discovered, I wouldn't be at all surprised to find that it runs the other way! The cleverest people I meet and the wisest people I meet are completely different groups. Just occasionally there is some overlap between the two!

I think there are (at least) two different kinds of "understanding". There is a logical/analytical kind of understanding which can be extremely useful, but can also come to some very wrong conclusions, particularly if it strays outside of the narrow range of problems to which it is particularly suited. Then there is wisdom. Wisdom comes from experience, from making good decisions (and sometimes bad ones), and from an instinctive or intuitive grasp of what is good, right and meaningful - from a deep inner sense of what really matters in life.

But how do you get wisdom? The book of Job (in the Old Testament part of the Bible) has this to say:
There is a mine for silver
and a place where gold is refined.
Iron is taken from the earth,
and copper is smelted from ore.
...
But where can wisdom be found?
Where does understanding dwell?
No mortal comprehends its worth;
it cannot be found in the land of the living.
The deep says, “It is not in me”;
the sea says, “It is not with me”.
...
                        - Job chapter 28
And what is wisdom anyway? The book of Proverbs says this:
The beginning of wisdom is this: Get wisdom1!

                        - Proverbs chapter 4 verse 5
A recursive definition if ever there was one!

Proverbs also says this though:
Does not wisdom call out?
Does not understanding raise her voice?
At the highest point along the way,
where the paths meet, she takes her stand;
beside the gate leading into the city,
at the entrance, she cries aloud:
...
                        - Proverbs chapter 8
So wisdom is both elusive and hard to find (according to Job) and shouting out in public to anyone who will listen (according to Proverbs). Both of these things are true - wisdom is sometimes best expressed through paradox! The logical mind doesn't like paradox and tries to resolve it. The wise heart knows how and when to accept it and hold both parts in tension.

I can't tell you where to find wisdom, but I can tell you that it is accessed primarily, not through the logical/analytical mind, but through the heart. Pascal spoke well when he said:
The heart has its reasons, that reason knows nothing of
Pascal also said:
It is the heart which experiences God, and not the reason.
And the quote from Job earlier goes on to say:
The fear2 of the Lord — that is wisdom,
and to shun evil is understanding.
Understanding in the sense of "reason" is a good thing and should be encouraged, developed, listened to and taken seriously, but reason will only get you so far. Understanding in the sense of "wisdom" will take you to a deeper level - a level that will show you what reason is for and teach you what to do with it.

Wisdom should be informed by, but not clouded by reason - don't let your "understanding" get in the way of your "understanding"!

Sunday, 19 August 2012

Life, Faith and Heuristics

The other morning I was lying in bed, thinking about heuristics. If you think that seems strange - well, I'm sorry but that's just what it's like in my head sometimes!

For those who don't know, a heuristic can be loosely defined as, "a rule of thumb". Most of us use heuristics all the time, usually without realising it.

For example, if you want to catch a ball, there are 2 ways you could go about it. You could take the computational approach, which you might use for example if you wanted to program a robot to do this.You could calculate the speed and trajectory of the ball, perhaps factoring in gravity and wind speed, work out precisely where it was going to land, and then make sure your hand was in the right place. Or, you could take a heuristic approach. This would be something along the lines of, "the ball is getting bigger very quickly - I need to move my hand back a bit", and keep adjusting until it lands.

Heuristics are useful because most of us don't have enough information most of the time to make perfectly calculated decisions (or fast or precise enough brains to do so if we did), so we constantly have to make best guesses based on what we do know. Our ability to make such guesses correctly (or at least optimally) is constantly refined through experience. If it wasn't for heuristics we would all suffer from "analysis paralysis" - we would spend so long trying to work out how to do something, or even what to do, that we would never actually get around to doing anything at all! The trade off though, is that sometimes we get it badly wrong! This is where science comes in.

For thousands of years, people have taken a heuristic approach to all sorts of things and come to all kinds of wrong conclusions. For example, based on the information available to them at the time, people concluded that the Earth was at the centre of the Universe and that the world was flat. Science on the other hand, takes a much more stringent approach, and sometimes comes to conclusions that seem quite alien to our heuristic-oriented brains. For example, through a rigorous process of scientific investigation, we now know that most of what we call "matter" is actually made up of empty space (!) - populated by tiny particles bound together by electromagnetic forces, which cause them to arrange themselves in various formations that appear to us as solid, liquid or gas*.

For most of human history it seems, most people have believed in gods or in a God, but nowadays it seems, at least in certain corners of Western Civilisation, that this belief might be on the wane. The wave of scientific progress over the last couple of hundred years or so has overturned and/or thrown into question so many of our traditional assumptions and beliefs. It has also given us a much-heightened sense of confidence in our ultimate ability to solve all the fundamental problems and questions of the Universe. Science has taught us to be suspicious of our heuristic interpretations of reality and to distrust anything that cannot be rationally tested and proved. At the same time though, heuristics continue to be crucial to living our daily lives.

If you want to catch that ball for example, you're going to have to use a heuristic approach - you simply don't have sufficient knowledge or brain-processing-power to do otherwise. If you're considering a new job and want the best outcome for yourself and your family - you cannot work out what will happen in the future and will have to make the best guess you can with the information you have. If you ever want to be in a relationship with anyone, you're going to have to decide whether or not you can trust them - but there is no scientific or logical formula for this! Instead, based on the limited information you have, you are just going to have to decide whether or not to take the risk.

Faith is a heuristic approach to life, and it seems clear to me that in the past (and no doubt in the present) we have got some of it wrong. Faith needs to listen to science and to learn from it (although not necessarily from everything that is said by all of its practitioners!), but science also has a few things to learn from faith. Science will never be able to prove that there is no God, and good scientists - even those who are the most staunchly atheist - will usually admit to this when pushed. By the same token though, science will never be able to prove definitively that there is a God, if indeed He is omnipotent and does not wish to be "discovered" or "analysed" in this way.

For all its remarkable achievements, science is just a tool and remains limited in scope and application. There is so much in life and reality that we don't know, will never fully know, and could never fully analyse if we did. Therefore, although science can and does furnish us with valuable data to inform our decisison making process, most of the important things in life - including faith - must continue to be determined by heuristics.

Sunday, 13 March 2011

Thinking 'til it Hurts!

I like to think quite a bit!

I have a fairly academic brain. I always did well at school. I enjoy maths and problem solving. I am a computer programmer, so logic is a big part of my job. I also enjoy the "softer" side of logic - philosophy, discussion and debate, weighing up arguments and counter-arguments, recognising the connections between things and considering the implications of an opinion or system of beliefs.

As a Christian, one of the things I think a lot about is my faith, which at times comes under significant attack from other thinkers and intellectuals. I think it's important to think about things, to ask honest questions and try to be honest with yourself about what you discover. I think there are some good, honest, rational reasons for believing in God, but although in my opinion there is a lot of evidence, there is no universally accessible and logically indisputable proof.

Sometimes though, I get tired of thinking! I can try to work everything out until I'm black and blue in the face (or feel that way anyway), but I don't have access to all knowledge, all wisdom, all intellect. My own logic is necessarily flawed in many places because I am only a finite, limited human being, and am influenced by all sorts of external and internal forces that I don't understand and cannot fully control.

Sometimes logic is just not enough and I need something else to fall back on. In the end, just thinking about God doesn't satisfy. At its core, the Christian faith is not about logic, its about an encounter, and this is where faith comes in - or at least where it starts. Faith - at least to begin with - is about reaching out into the unknown and daring to believe that something (or someone) might at least be there. There's plenty of information in the Bible, recorded by people who have had encounters in the past, that can inspire us to reach out and help us to make sense of what we might find. The church community exists - at least in part - so these experiences can be shared, interpreted and applied.

In the end though, the only way to know God is to reach out to Him for yourself. All the logic and reason in the world will never get you there! Those who can do this genuinely, in humility of heart, not expecting to understand everything they find, are usually those who discover that God has actually been reaching out to them the whole time.