The heart of computer programming

Posted by

Years ago I was in a restaurant with my husband and we got into a discussion about object-oriented design for human-computer interaction, super sexy talk for Friday night, date night.

His argument was that object-oriented design is perfect for graphical-user design, as it lends itself to the code of each window being represented by an object. I disagreed saying that it is too restrictive and would cause code redundancy and repetition.

Thinking about it now, we were both right. That night however, we were both so determined to be the one who was right, our discussion got a bit heated, so much so, that the people on the next table asked to be re-seated over the other side of the restaurant.

It was probably around this time that we got Donald Knuth‘s The Art of Computer Programming. Back then it was three volumes, now it’s four and counting. When I think of this behemoth, it reminds me a bit of another biggie on our bookshelves, Cervante’s Don Quixote which is a total classic that people don’t finish because it is very long and frustrating in parts. It is recognised as an important novel for many reasons, not least of all because it encapsulates a certain period of Spanish history and the Roman Catholic Church.

We could say the same about The Art of Computer Programming. No one finishes it, because it is long, frustrating, and also important, as it encapsulates a certain period of computing history. Knuth is concerned with mathematics for programming whilst exploring mathematical conjectures, and: the connection between computers and mathematics [which] is far deeper than … traditional relationships would imply.

And, that’s great if you are a mathematician. Knuth is so right about computer programming.

However, I am not a mathematician so I have very different ideas about computing programming which are also, so right.

Liking the idea

I like the idea of mathematics (rather like the idea of gaming) and went to a fascinating talk in 2017 by mathematician Professor Ursula Martin, called Mathematics as a Social Machine about mathematicians working together online to solve theorems using the Erdos discrepancy, i.e., a solution may contain errors but is good enough for now so that everyone can get started.

I was so inspired by the talk that I wrote a blog on trusting technology and working with others, but I left out the mathematical conjectures because … what can I say? The nitty gritty of the maths, the proof, the formulation of the equation just doesn’t excite me. I can read maths, I did indeed spot an error in some equations in my husband’s maths PhD thesis in the section on asymptotic expansions, no less, and I am still chuffed to this day. However, I just don’t enjoying wading through equations, it strains my brain, rather like when I read French literature and everything is written in the past historic. They are not natural ways of communicating, for me.

Martin began the talk by asking us all to put our hands up to see at to what level we were educated to, mathematically-speaking. She began with PhD, then BSc, then ‘A’ level. I was the only woman in the room she hadn’t met before and as us women were in the minority, as usual, I could see that she was curious about when my hand would go up.

It didn’t.

I present as a computer scientist but I don’t have any of the formal qualifications in mathematics for which she was looking. I have a GCSE in maths, but she didn’t go that low, I guess, it was a given that everyone in the room had one. I have one because it was compulsory and the only time after that I had to engage with mathematics was during my PhD years when I spent a lot of time with Stroud’s Engineering Mathematics so I could get up to speed with Benouilli and Euler-Benouilli’s beam theory so that I could code them up to interpret my big data. Oh, and I did a lot of modelling data analysis, but that really didn’t feel like mathematics, so I quite enjoyed it.

I can do mathematics and I appreciate and applaud its beauty. However, I need a why, to get me to the what and how.

What’s your why?

It wasn’t always the case. I loved mathematics until I was about 12 years old and then had a maths teacher who didn’t like me, or anyone else for that matter, asking why, so I stopped connecting to mathematics. Around that time several other things happened, too: A) all of my clarinet lessons took place during physics, so I totally missed out on how I could use mathematics. B) My usual English teacher was off school and our substitute kicked off by reciting John Betjeman’s A Subalterns Love Song in class and I fell hard for English Lit in a way, which if I think about it, I’ve never really recovered from, nor have I wanted to. And then, C) the organist played Bach’s Toccato and Fugue in D Minor, after service one day, and I felt such a rush. The world cracked open and showed me that there were so may other ways in which to describe life. It didn’t have to be all formal, it didn’t have to be fusty, dusty mathematics, there could be story, music, drama and emotion. God, even now, I love hearing Toccato and Fugue played and when the organist runs up and down on the pedals (well if she’s small like me) and literally pulls out all the stops for the dramatic Halloweeny beginning, it still makes me shiver, in a good way, ASMR way, the all over body way.

Getting excited

And that’s it for me, I want to experience it, love it, get excited by it, and stay up all night with it but alas The Art of Computer Programming is a mathematician’s way of thinking about programming and formalising equations which doesn’t light me up, it just doesn’t do it for me. Indeed, the only explanation I have ever read about mathematics which made me feel something was the one in Cryptonomicon which ends like this:

When Lawrence understood, it was as if the math teacher had suddenly played the good part of Bach’s Fantasia and Fugue in G Minor on a pipe organ the size of the Spiral Nebula in Andromeda.

Cryptonomicon, 1999

I know the excitement of hearing Bach played on an organ, I have felt it, which is exactly how story works. It has to feel true, it has to create connection and resonance to me, the reader, otherwise it’s just words on page, or indeed a list of instructions.

Knuth knows this too, because he invented literate programming (I talk about it here, along with stepwise refinement) which has the goal of explaining to human beings what we want a computer to do instead of just giving a computer a list of instructions and expecting the human to follow because:

Programming is simply the act of entering instructions for the computer to perform.

Al Sweigart

So, we need to find out what we want the computer to do before we write the list. And, this is the very heart of computer programming. It is the communication with ourselves, in dialogue with the computer, and in connection with other people that matters because it excites us, it lights us up, and drives us to design and improve our lives. Less art, more heart, as far as I am concerned.

The heart of the matter

When we begin to formulate a problem, we need to ask some questions:

  • Why am I using a computer to do this?
  • What can I do easily but the computer cannot?
  • What can the computer do easily which I cannot?

Literary Informatics Librarian Dr Heather’s Froehlich blogs about how computers help her answer the questions she would struggle with as a reader. They keep track of the presence and absence of characters or gender-specific words, say in Shakespeare’s plays. She began using a concordancer, which are apparently expensive to buy and some csv files, which other people had designed.

She then learnt python because she wanted to write her own code and choose her own data, so that she knew exactly with what she was dealing instead of relying on other people to do it for her.

The advantage to getting a computer to read Shakespeare is that it doesn’t remember incorrectly, it doesn’t have to wonder: is this true? Or just what I feel to be true? Humans remember things differently over time, we filter our experiences, due to our embodiment and the way our culture is structured. And, when we go back and reread something, depending on our age, we experience it differently. A computer just counts and then the human interprets that number, oooh but I suppose still depending on age and experience.

Ultimately, Froehlich wants to find new stories in old ones, particularly where gender is concerned. This is something I love to think about. I want to hear the old stories retold with women centre stage feeling rather than thinking and women who are not just objects. I read lots of Froehlichs blogs in a super excited way.

Analyse this

I am often told that I over-analyse everything. Ruth give it a break. Do you have to analyse everything? And the answer is yes I do. Thankfully, my husband does not say this to me, though sometimes we stop part way through a conversation to ask: Are we overthinking this? To which our kids say: Yes. But, that is because a lot of adult talk is truly repetitive and doesn’t break new ground. In the same way a lot of old stories are retold, without any new insight.

Alone, I think I analyse things as much as I do because a lot of life still just doesn’t feel quite right. It feels a bit like the the Art of Computer Programming and that the given view/model of a problem doesn’t quite vibe with me, and so I have to do my own thinking, my own analysis, to get to the heart of it, to find new stories in old ones and a way back to myself.

The Three of Swords

And, that is what happened too with me and the Three of Swords Tarot card at the top of this blog. In Tarot it represents heartbreak, misunderstandings, loss of love, and grief. The swords represent air and our thoughts, whereas cups represent water and our emotions, but not on this card, there no cups.

Previously, I looked at it literally – the heart is pierced by swords, causing immense pain – but symbolically it is thoughts which are causing pain, and ain’t that the truth in life? Sometimes, heartbreak is caused by our perception of a situation, a perceived loss of love. I heard someone say the other day that the latest research shows that when we fall in love with someone, we fall in love with the way we feel around them. And if so, is it true that…

The greatest griefs are those we cause ourselves

 Sophocles

When we fall out of love, it’s because we are no longer getting that feeling, and our feelings aren’t dependent on other people, it’s just we think they are.

I’ve always interpreted the rain as tears and sadness on the card. But rain and tears are cleansing and healing, and temporary, like the clouds, which will disperse to let the sun shine through, as it is always shining, just sometimes we cannot see it.

And, so it was, from analysing something in detail and looking at it in a different way, I found a new and comforting story which feels just as right as the old one and more suitable for me.

Less art, more heart, to which I will add – and more comfort, always more comfort.

8 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.