On expressing intent

In programming, one of the hallmarks of well-written code is the fact the code communicates intent. For example, a piece of code could be taking a list of integers, summing them up and dividing the sum by the number of integers involved, but it makes it far easier when the piece of code is actually labelled getAverageValue.

That is intent.

Being able to communicate intent when coding is especially important when working in the context of a development team. Chances are, somewhere down the track, another programmer will need to interact with, or make changes to code that you’ve written. When that time comes, one of the first questions he/she’ll be asking is “what was the author trying to do?”.

getAverageValue
Success!

“Loop over a list, sum up all the elements in the list, count the number of elements in the list, divide the sum by the count”
Fail.

Coming clean with intent isn’t always easy though. In the limited example above, explicitly stating that one’s intention to derive an average value quickly opens oneself up to criticisms on technique, algorithms used, coding style, etc. So vulnerable is such a position that one would often prefer NOT to state intent, opting instead to just step through the instructions one at a time.

But here’s the nice thing about communicating intent – it opens up a space for individuals to share and collaborate over a piece of work.

You see, to put forward intent is a posture of respect toward the other party. It is an invitation to collectively deliberate over a matter. Correspondingly, to ask “why” is a request to participate in one such engagement.

For example, instead of just saying

“Please do this because I told you so”

one might instead say

“Please do this so that the world will not come to an end”.

No prizes for imagining the effect the former statement might have on a conversation. The latter, on the other hand, opens up far more opportunities for discussion, i.e. –

“I don’t want the world to end either, but here’s possibly a better way to achieve it”

or

“I don’t think the world will end. Let’s talk about why you think the world will end.”

Lots of room to parley and a far better chance of arriving at a progressive and agreeable outcome.

Scapepost

After putting out a big post that took an extended period of time to write, I’ve found myself in a bit of a writer’s bind.

I’d get on the train, hang the helmet on the bike, stow the bike in some immobilizing position, remove my gloves, keep them in the bag, pull out the laptop, and start hammering away on the keyboard.

I only get as far as 3 sentences before the critic in me kicks in – the subject matter is boring, no one’s going to like this, are you sure you know what you are writing about, and the clincher – it’s not as good as that last one.

Stopped short, never to go again.

So here is a scapegoat post to reset the bar, crucify the critic and afford a fighting chance for all the posts that have yet been conceived.

Boredom lays in the mind of the consumer. I’m never going to get it absolutely right, and I’ve yet to produce my best work.

So there. Let’s get on with writing.