Saturday, 5 July 2014

Past, present and future me.

I think more than is probably good for me. I think about conciousness, time and the nature of reality along with a whole bunch of other things. My current wondering is whether or not I can put into words my thoughts on what it is that makes me me. For what it's worth, I'm guessing the answer is no.

As an old person, I have a long and rich history of being me.

  • First there was baby me,
  • then child me,
  • teenager me,
  • 20's me (that guy! Ha, what a hoot),
  • 30's me,
  • more recent me,
  • there's right now me,
  • tomorrow me,
  • Monday morning me (man, I feel for that guy)
  • future me.

Of all those people, "right now me" is the guy I feel closest to. Having said that, I'd probably be prepared to put "right now me" to some small difficulty for tomorrow me, or even a probably future me. Looking back though, I barely remember baby me and I can certainly empathise more with people at work or my family than I can child me - which seems a little strange. Especially when you think that past me actually happened! My memories of past me are surely what go to create "right now me", future me, however, is just a figment of my imagination.

Past me

My brain makes sense of who, what and where I am from my memories. In a simple example, I can follow my train of thought in this blog because I remember why I wanted to write it, I remember sitting down with a cup of tea at my desk - causality is complete. It's easy to understand what happens when that breaks down too - when you walk into a room and forget what is was you went in for. Obviously, my relationship with me goes back further than that, I sat down at my desk to write this blog post with a cup of tea, milk and no sugar, because 30's Ant decided to stop taking sugar in his tea. In a less trivial and slightly more esoteric example, the way I deal with my colleagues at work is different to that of other people. It's different to the way 20's and 30's me did. But there's a fading silver thread that connects us - showing the evolution through time of right now me.

None of those past me's exist in anywhere but my memory and my memory is faulty. I know this because other people's rambling stories about 20's me don't really gel with the handsome young rake I recall. Also - science says it's so - well, the Atlantic anyway. So, I've interpreted my life differently to others and my memories aren't super faithful captures of reality. They are more of an artists impression of stills from the life of me. So, these faulty impressions are what keep me seeing my life as a joined up journey from birth to death. It's not having the same body (as I'm replacing it, bit by bit, over the years of my life). It's certainly not reality. It's just a series of memories which create a complete, unbroken narrative.

Broken narrative

When I wake up in the morning and recall going to bed that night, there has been a definite break in the flow of the narrative. Your internal memories just stop, then start again 8 hours later. If, during your sleep you were cloned, I think most of us would naturally agree that the person who woke up next day in your bed would be you. The person that woke up in the cloning room wouldn't.

Who would the person waking up in the cloning room be? They would wake up in a strange room with all of your memories, right up to going to bed that night.

I think the answer becomes a little less obvious if you now imagine the Star Trek transporter. This device would disassemble people in one location and then reassemble them in another. Is the newly materialised person you? If the answer is yes, then the only reason it can really be you is if the definition of you is your memories.

Now me

It is easy to imagine seeing an unbroken narrative in action when you are at work interacting with a colleague and one moment has to follow another in a sensible order. Even though time has past it's easy to believe that "start of the conversation" you is the same person as "end of the conversation" you. But she isn't, "start of the conversation" you is dead, consigned to the foot notes of history. You can't go back to her and get her to change the course of the conversation.

If we follow this logic, every attempt we make to define "now me" becomes, in the very moment of cognition, "past me". "Now me" seems to exist in an almost impossibly thin fragment of time, by the time we have recognised that something is happening to "now me" it's a memory.

Future me

This is thus the only guy who can really be relied on to get anything done. So he's also the guy we have to protect and care for. Imagine you are told you will be given £20 and a punch in the face. If you could assign each of those to a particular you, I'm guessing most people would assign punch to past you and the money to present you for future you to make use of? How much strain "now you" will take on to make things easier for "future you" seems to vary greatly. I find it quite an interesting concept and way to think about reality. To the point where I think in this manner. If I am performing some particularly onerous task for future me, I hope he'll appreciate it, or if I'm being lazy, I'll think "Ha! Screw you Monday morning Ant I'm leaving it to you to fill the car with petrol".

Who am I?

Well, past me is clearly a lie - me as seen though a glass darkly. Present me is too fleeting, gone before I ever get to know him. Which just leaves future me, who doesn't even exist yet and he's only a figment of my imagination! Each of my memories is just a frozen instant in time like a single frame in a movie. Just like a character in a movie, I am the summation of all of those snapshots played at 25 frames per second to create a coherent narrative. I am that narrative...



Good enough

I was reading a blog post by one of my favourite authors talking about how difficult he finds it to hand in a manuscript.

"It’s a hard thing for me, letting go of a manuscript. Other authors are very matter of fact about it. But for me, obsessive word tinker than I am, I hate knowing that after a certain point I won’t be able to go in and fix things any more."

I feel something very similar when I'm coming to the end of a milestone and the code I've been working on is getting close to "complete". Because I am paid to create functionality and not art, it's actually possible for me to over polish the code. So I thought I would write about what goes through my head when I'm trying to decide if my code is ok. Obviously, the code has to meet the written requirements - otherwise it is deemed "not good enough" by QA.

Meeting the written requirements

  • Obviously, the software I write has to meet the immediate functional requirements - it has to work as intended.
  • It, usually, also has to meet the design requirements - it has to look right.
  • There are also user experience requirements - it has to feel right.

However, the written requirements tend to deal with the tangible parts of the software. It now becomes a judgement call on the part of the developer whether the code she has written meets the required standards for the unwritten requirements - things like maintainability, readability, reusability, extensibility, architecture and test quality. How important these requirements are depend very much on what you are building and the time frame your are working in.

I genuinely believe there is more value in a developer who develops good quality software quickly, than code poetry slowly. I justify this by saying that after a certain level of quality in a piece of software the effort starts to out weigh the gain and the reason for putting the effort in becomes less about the software and more about developer ego. I think the developer who understands this and judges correctly when to stop is the better craftsman.

Meeting the unwritten requirements

Software is constantly evolving and it's sometimes not possible to come up with the "best" solution for a piece of code until after it's been in use for a while. We were seeing lots of forking in the code where data needed to be processed differently depending on certain circumstances, so we decided to write a more elegant method of dealing with this. I closed the code review in which the final outcome of the discussion was to leave the code unfinished and revisit it to see how it's actually being used. The more time that has past, the more I think that turned out to be a really good idea. We waited to see how other developers would need to use it and how some might try and abuse it. The solution we have now makes the common forms of abuse much more difficult, while aiding the current common usages.

The above is, in my opinion, an example of where good quality code really shines. The code doesn't just perform it's own task, it creates a process for other developers to quickly perform similar tasks. When given a new task, most developers will look at the system and see if something similar has been done before. At some point, your code will likely be used as a base for something similar, or a small part of it will be used as the pattern for "doing x" in the system. You can aid in this by making the code easy to read and understand. If it's loosely coupled, it'll be easier for other devs to work into something new and that new thing will likewise be loosely coupled.

I am a big fan of using tests to help other developers understand the subtlety of the requirements of my code. If I make an assumption during the development of some code and it turns out to be wrong, that's a test right there. If a future dev makes the same assumption and introduces a bug because my tests didn't fail - that bug is on me.

When trying to decide if my code is "good enough" yet, here's what usually goes through my head:

  • Would I be ok seeing this code replicated through the system.
  • Is this problem local to this code, or do I need a global solution for other devs to use.
  • Is this problem properly tested.
  • Can I justify changing this?