Monday, 16 March 2009

Rules for system designing #1: If a system can be gamed, it will

I first encountered this rule in web development, but once spotted I discovered it holds true in many, many diverse areas of life.

When designing a system of rules or procedures (a computer program, laws, a business's internal policies and procedures, etc) it's always tempting to ignore or avoid edge-cases - they seem so obscure or unlikely it's tempting to decide they don't matter, and not to bother resolving or fixing any ambiguities or loopholes.

People think about systems of rules the way they think about other people - you don't have to be too precise, because it'll be clear what the intent of your words is.

However, once set up systems are administrated according to the rules which define them - while "the original designer's intent" is nebulous and open to interpretation, the letter of the law is usually quite specific, even if the eventual result of them is quite different from what the original architects intended. Nobody ever got fired for following the letter of the law, even if by doing so they did great violence to its spirit.

This can be seen in all walks of life - if you're a naive programmer developing a web application it can seem tempting to ignore security holes or undefined edge-cases. "Who will ever spot that?" you think to yourself, "nobody will bother poking around in odd corners of my application, or try firing odd url parameters into my server. I'm much better off adding Whizzy New Feature #436 to my application than tidying up some dusty old corner of the code".

This sounds perfectly reasonable to most people, but any experienced web developers will be shaking their heads about now - first off, when you write code for websites your code is exposed to the entire internet, and there's always someone out there who'll start poking it with a stick, just to see what it does.

Even worse, there are also whole swathes of entirely automated systems like web spiders, spam-bots and automated vulnerability scanners that will systematically follow every link and try every combination of URL parameters it can imagine, simply to see what will happen.

The key point to take away here is that - almost invariably - your audience will turn out to be a lot larger and more diverse than you imagine, and what might seem obscure, boring or unimportant to you might not seem the same way to all of them... and neglecting to handle these edge-cases can lead to the entire system becoming compromised.

Likewise, laws suffer from this problem - they're typically crafted using vague language, and - like any non-trivial system - typically contain numerous unspotted edge-cases and loopholes. Moreover, the equivalent of issuing a patch to an existing law once it has been passed is about as complicated, fraught and long-winded as passing the law in the first place, making it difficult, time-consuming and expensive to correct errors once a law has been passed.

Like programs, relying on obscurity to paper over these loopholes is a mug's game - when laws apply to the number of people in an entire country you're pretty much guaranteed that eventually someone will either deliberately target or just stumble upon an unhandled edge-case. When this happens the system can be gamed, and the laws fail to perform their required function.

When this happens, the results may be anything from a single individual getting away with a parking ticket to your entire society taking a turn for the worse.

Remember: if a system can be gamed, it will, so take care to eliminate all possible edge-cases, and practice defence in depth so when an unknown compromise or loop-hole is inevitably eventually discovered, the amount of the system which is affected and can then be compromised is limited.

This advice applies equally whether you're a developer writing computer code, a politician crafting new laws or a manager adjusting business processes in a company. If it's a system of rules, this design axiom applies.

Friday, 9 January 2009

Lifecycle of a meme

A recent discussion on reddit prompted me to sketch out the stages of an internet meme's lifecycle.

Lest there be any confusion, I'm talking here about internet memes - LOLcats, Soviet Russia jokes and the like, not about memes in the more general sense of the word.

As far as I can see, all memes go through this lifecycle:

  1. Meme is born. Almost nobody understands it, and it's barely funny even when you do.
  2. Meme gets adopted by a specific social group. Meme now serves as a shibboleth indicating membership of the group, and encourages feelings of belonging and "insidership" whenever it's encountered. At this stage, the meme is usually either utterly baffling or hilarious, depending on whether or not you're an insider in that social group.
  3. Meme becomes mainstream - everyone is using it at every opportunity, and - its use as a shibboleth negated - it gradually gets stale from overuse. Meme is hilarious to newcomers, but increasingly sterile and boring to older users.
  4. Meme effectively dies - people using it are generally downmodded or castigated for trying for "easy" posts. Importantly, it can still be funny even at this stage if it's used particularly well... however, 99% of the uses at this point are people trying to cash in on easy karma - the kind of people who tell the same jokes for years without realising that the 17th time you hear it, it's no longer funny.
  5. Meme is effectively dead, but may experience rare and infrequent resurrection in particularly deserving cases. Generally these uses get applauded, because nobody wants to risk approbation for posting stale memes unless they're really sure this is a perfect opportunity for it - one that's literally too good to miss.

Importantly, by stage 5 the meme starts once again to be funny, because it's once again serving as a shibboleth... though this time instead of showing how advanced and up-to-date the poster is, it instead serves to indicate his membership in the "old guard" of whatever social group it's posted to - "I've been around here so long I remember when this was funny", it quietly indicates to other old-timers and well-educated newbies alike.

Thursday, 1 January 2009

Engines of reason

Initially we as acted as individuals - what we understood of reality was what we experienced and determined for ourselves. There was no understanding or appreciation of the world outside our direct experience.

Later we developed language, and what we understood of reality was formed from our own perceptions and conclusions, influenced by the perceptions and conclusions of our family and social group (family, clan, village, etc).

Next we developed the printing press, and mass-media. These allowed centralised governments and organisations to accumulate and weigh information and experiences and broadcast them to the populace. We still held our own council on personal or local matters, but since we rarely (if ever) knew anyone who had experienced such events outside our local region, we largely received all our knowledge and understanding of the outside world from centralised authority - governments, news media organisations, etc.

Finally, with the advent of the web we're enabling anyone to publish their personal experiences, in a way that anyone else in the world can then receive. No longer do we simply not have access to information, nor do we receive distilled, refined, potentially biased information from one or a few sources. Now we're capable in theory of hearing every point of view from every participant in an event, untainted by anything but their personal, arbitrary biases.

We are still receiving information on a global scale, but for the first time it's potentially all primary evidence, untainted and unfiltered by a single agenda or point of view.

The trouble with this is that brains, personalities, cultures and institutions long-accustomed to received wisdom now have to compare, contrast, weigh and discern the trustworthiness of multiple conflicting points of view for themselves. For the first time since our pre-linguistic ancestors you - and only you - are primarily responsible for determining truth from falsehood, and for the first time in history you have to do so on a global scale, involving events of which you have no direct experience.

To be clear: this is hard. Many people instinctively reject the terrifying uncertainty and extra effort, instead abdicating their personal responsibility and fleeing to any source of comforting certainty they can find. This explains why even in these supposedly scientific and rational times people still subscribe to superstitions or religions, or simplistic, fundamentalist philosophies, or blindly consume and believe opinionated but provably-biased sources like political leaders, charismatic thinkers or biased news organisations.

So it's a double-edged sword - for the first time in history we have access to primary evidence about events in the world, rather than receiving conclusions from a central source along with only what secondary or tertiary evidence supports them. However, in doing so the one thing we've noticed is that the channels we've relied-upon up till now are biased, agenda-laden and incomplete.

Obviously in an ideal world everyone could be relied-upon to train their bullshit-filters and research and determine the truth for themselves. However, given the newness of the current situation we can't rely upon this any time soon. Likewise, given both the sheer volume of information and humanity's propensity for laziness and satisficing, we'll likely never be able to rely on the majority of people doing this for every single issue they hold an opinion on.

So what's a species to do? We've turned on the firehose of knowledge, and it's shown that the traditional channels of received wisdom are unreliable, but many people find it impractically hard to drink from it.

There are three choices here:

  • We could allow the majority of people to reject their responsibilities and abdicate their reasoning processes to others of unknown reliability... though this is the kind of thing that leads to fundamentalism, anti-intellectualism and cultural and scientific stagnation.
  • Alternatively, we could encourage people to distrust authority and try to decide for themselves... though even if we win, if the effort of self-determination is too great we risk merely leaving people floundering in a morass of equally-likely-looking alternatives (I believe this is a primary cause of baseless, unproven but trendy philosophies like excessive cultural relativism - if you're lost in a sea of indistinguishable alternatives, it's flattering and tempting to believe there is no difference in their correctness).
  • Lastly, we can make an effort to formalise and simplify the process of determining reliability and truth - striving to create democratic, transparent mechanisms where objective truth is determined and rewarded, and falsehood or erroneous information is discarded... lowering the bar to individual decision-making, but avoiding unilateral assumption of authority by a single (or small group of) agendas.

Stupid as it may seem, I believe this is the ultimate destination towards which sites like reddit or Wikipedia are slowly converging - people post evidence, assertions or facts, those facts are discussed, weighed and put in context, and (so the theory goes) accuracy and factual truth is ascertained by exposing the process to a large enough consensus.

It doesn't always work - many of these early attempts suffer from a poor mechanism, or attract a community who vote based on their prejudices rather than rational argument, or end up balkanised in one or more isolated areas of parochial groupthink.

However, the first heavier-than-air aircraft didn't work too well either, and here we are a few decades later flying around the planet faster than the sun. As a species we're still only a few years into what may be a decades- or centuries-long process - one which could change the very foundations of (and mechanism by which we determine) what we understand as factual reality.

People love to rag on social news sites, discussion forums and sites like Wikipedia for what amounts to failing to have already achieved perfection. I prefer to salute them for what they are - hesitant, often blind, stumbling baby-steps towards solving a problem many people don't yet even realise exists.

Friday, 5 December 2008

The web is not a sheet of paper

Print-turned-web designers:

  1. Learn the medium you're working in. A five minute video of even the best print advert makes for a lousy TV advert. Likewise, techniques and habits refined by years of print design are often sub-optimal or flatly counter-productive when applied to the web.
  2. For the love of god, give up on pixel-perfect positioning and learn to appreciate flow layout. Sure, it makes design harder... but if you think designing flow layouts is hard, think about the poor schmuck developers who have to implement the damn things. And if you think flow layouts are ugly, let's see how good your precious pixel-perfect design works when I do something freakishly unusual like resize my browser window.
  3. Print pages are Things To Look At. Web sites are Things To Use. Prioritising aesthetics over usability or functionality is like putting a car steering wheel in the middle of the dashboard. Sure it looks nicer, but it makes the whole product useless. Incidentally, I swear if I get one more design through with a "button" image specified but no "pressed button" image (or "link" style but no "active/hover/visited link" style) I will personally bite off your head and defecate into your body-cavity. You have been warned.
  4. Conventions are not boring - conventions are your friend. Putting light-switches near doors is a convention. Sure, putting them square in the middle of the ceiling is innovative, but then so is cheesegrating your knees (hey - do you know anyone who's done it?). Innovative means "nobody else is doing it". Accept the possibility that nobody else is doing it because it's a fucking stupid idea.
  5. I don't want to "explore the interface". I want to get in, do my shit and get out again. If you think forcing users to explore the interface is such a good idea, try ripping the labels off all the cans of food in your cupboard. A couple of meals of cat-food, chilli and peaches should demonstrate exactly how "fun" this is for your users.

PANT, pant, pant... pant... ahem.


Originally via reddit.

Fear, Instincts and the Patented Lightning Test

Our mass-media (meme-propagation system) has increased in efficiency tens or hundreds of times faster than our context-supplying instincts.

We evolved in loose groups of 150-250 individuals. If you heard about someone getting eaten by a tiger then, chances are you should watch out because he was likely only a few hundred metres over that way, so the danger to you was very real.

Then we started to hear about things that happened to someone at the other end of the country, and suddenly it seemed like there were murderers and rapists and nutjobs everywhere, because barely a day went past when we didn't hear of someone getting killed in an inventive or gruesome way.

Now we've got the web, and e-mail, and satellite TV, and blogs, and we hear about it if a mouse farts in Buttfuck, Antarctica. And now it's not even safe to let your kids walk to school for fear of them getting molested, you can't get on an aeroplane for fear it'll be bombed out of the sky, and you can't visit the toilet in your own house without getting abducted and beheaded by terrorists.

The only way to tackle this is by recognising what's going on and overruling your instincts. They served you well ten thousands years ago when you lived in a tree and had to avoid tigers, but now we're living in condos and keep small tigers in the house as pets.

Try my patented Lightning Test: Look up the statistics of whatever the latest mania/terror/panic is about, and only worry about it if it's more likely than… oh… say… getting hit by lightning.

Try terrorism - look up the number of deaths from terrorism each year, then look up the number of people who get hit by lightning.

Now if someone's advocating taking away civil rights because of terrorism, or locking up our children because of paedophiles, you can apply the simple test: Are they also advocating the compulsory wearing of earthed metal hats and rubber gumboots?

If not, then their little pet crusade is clearly disproportionate and can be safely ignored.


This has been a Public Service Announcement from the Lets All Get A Fucking Grip Society. Have a nice day.

Thursday, 27 November 2008

Intellectual comparisons involving wood

True story: in UK schools they used to run an extra-credit annual maths test called the Maths Challenge (or something equally imaginative)[1].

The test was a series of 20 maths problems - "a snail climbs up from the bottom of a 10 ft well, moving up five inches every day and slipping back three inches every night. How many days does it take him to escape from the well?" being typical.

You started off with 20 points, scored +5 points for a correct answer, -1 points for a wrong answer and 0 for a question you didn't attempt (so your final score was in the range 0-120).

Pretty much all the kids worked out immediately that this meant you could answer 4 questions you weren't sure of for every question you were, and you'd still end up with at least a few additional points... all except my friend Dan.

Dan ploughed ahead, attempting nearly every question on the paper. When he got his mark back he'd only scored around 15-17. He wasn't too bothered, however, until we realised that he'd scored worse than the 20 points he'd have got if he hadn't answered a single question.

In other words, if the chair he was sat on had taken the test, it would have scored higher than he did.

This is the true story of how my mate Dan was once proven to be dumber than furniture.

(originally posted on reddit)


Footnotes:

[1] Awesomely, apparently they still do. Oh, and I got the scoring slightly wrong from memory, but the principle remains the same.

Sunday, 16 November 2008

"Offended" is a choice you make

We'll start with an epiphanette[1] vouchsafed to me by an insightful friend:

Offence can never be given, only taken.

In other words, before you can offend me, I have to allow you to do so.

It's understandable that many people don't realise this - given a strong emotional reaction to a subject, I may instantly feel offended by something someone said. I make no conscious decision, and the only action I perceive is the original statement - it looks like simple cause and effect.

However, the important word is perceive - sure, it looks to me as if my offence was a direct effect of the statement, but that's not actually true.

Offend me. No, really - go on...

Call my mother names. Impugn my political affiliation. Assert things about my sexuality. Go on - post comments or e-mail me, if you like. All of these things can be reliably guaranteed to cause offence to people, but I promise I won't get offended by any of them. How can this be?

It's because I've simply chosen not to take offence at them. This much is obvious, but wait - if a statement is or is not "offensive", how can I choose whether or not to be offended? If "being offended" is a direct consequence of the statement, how can I opt out, and merely decide not to be?

The point here is that being offended is a choice. It might be the default choice - one I usually take automatically, or without even being consciously aware of it - but if I can choose not to be offended, surely that proves the opposite choice (being offended) is also a choice?

If offence can only ever be taken, then the "offensiveness" is your reaction to a statement, not a property of the statement itself. Moreover, it's not even a reaction the speaker can necessarily predict ahead of time - I make a statement, and then you decide whether you're offended by it.

Always remember this fact - every time you are offended, it's because you have chosen to feel that way. The nasty feeling you have is a direct consequence of your choice, not of the statement which motivated it.

The case of deliberate provocation

Obviously, some statements are made with the deliberate intent to offend you. It's understandable (though not admirable) that in these situations it's hard to overrule that emotional reaction - when someone tries to insult you, it's hard not to be offended.

To see why this is a problem, let's reason by analogy:

When babies are born, they have no bowel control - if their bowel is full, they'll shit. As far as the baby's concerned it's an automatic process.

However, as we grow and develop we learn that although excreting is an automatic process, we can learn to make it a conscious choice. Even if (through some biological problem) we can't do this, we at least recognise it's a fault within ourselves and strive to ameliorate it (for example, with diapers, medication, colostomy bags, and the like).

What seems like an automatic process we have no control over can - with recognition and effort - be mastered and controlled. And the more we practice it, the less difficult it becomes, until our chosen option becomes the automatic one (seriously - when was the last time you took a conscious choice not to shit yourself?).

Likewise, although "being offended" feels for many people as if it's something beyond their control, this is an illusion caused by their own lack of self-control. It's effectively emotional incontinence.

Given this, how fair is it to demand others change their actions based on a flaw within ourselves? It seems to me rather like demanding that everyone else carry around a potty at all times, just in case I want to take a shit.

Applying this reasoning to incontinence makes the reaction seem ludicrous - obviously my lack of self-control is my problem to deal with. Anyone who insisted everyone else has to scramble to solve their own problem while they themselves did nothing would be considered enormously selfish, demanding and immature.

So why when the issue is an emotional lack of control do so many people insist others change their behaviour, instead of asking what it says about them?

Can we as a society stop thinking of "offendedness" as a blameless condition, and start thinking of it as a lack of self-control? Can we stop advocating banning "offensive" things, and instead strive to fix the flaws within ourselves that mean they bother us so much?

Please - if you've remotely enjoyed this post at all, I want you to promise me something. Next time you read or hear something really offensive - something that really makes your blood boil - do me a favour.

Instead of shouting back or demanding something be banned, I want you to sit back, count to ten, and ask yourself

Am I shitting myself in public?

And if you are, and you decide to do it anyway, and then blame it on someone else, what does that say about you?


Footnotes

[1] Epiphanette: like an epiphany, but less-so. An interesting little thought that explains something fairly profound, but isn't really world-shaking enough to qualify as a full-blown epiphany. And no, sadly, it isn't a real word. ;-)