Hex Code

Well I suppose I’m a programmer now. Of all things.

It’s not what I expected, to be honest. I still associate the word with men in lab coats and bow ties in front of banks of flickering lights, doing arcane things at rattly teleprinter terminals. Something to do with rockets probably. Robots even. And punched paper tape!

Hippo

Punched paper tape was amazing, I used to collect discarded lengths of it from offices where my mother worked as a temp. Its perforated patterns are the perfect metaphor for the state of computing when I was a child. Pretty, delicate, clearly meaningful and yet profoundly mysterious.

These days? It’s writing really. You’re using language, a kind of language, to convey your intended meaning. Like much writing it’s part creativity, part drudgery and repetition. Long-separated senses of the word “hack” meet by surprise in a foreign city.

And like their natural counterparts, programming languages are a pretty diverse bunch. But you’ll hardly find two more different than the ones I just certified in – SQL and PHP. They’re like Choctaw and Chinese. Or more helpfully, Latin and English. One is (relatively) ancient, dusty and rule-bound, the other young and a bit anarchic.

Strangely though, it’s the old one that was actually designed to be English-like. And in the time of the lab coats I guess it seemed like it. A SQL command is called a “statement”, and is constructed much like a sentence:

Select roses, tulips from basket join bouquet where colour = "red"

Sounds almost like the real thing, doesn’t it? But…

Select camel, serendipity from D547 join moonslip where fandango = "buttocks"

…is equally meaningful. The resemblance to human language is superficial for a reason: In SQL there is only a handful of verbs, representing the very limited set of things you can do with items in a database. Its ‘nouns’ are little more than arbitrary labels. Real language is almost immeasurably more complex than that.

The thing that makes SQL seem completely unnatural though is its obsession with data types. These are important up to a point of course. You need to know what kind of data you’re dealing with, whether it’s numbers, “string” (which is what programmers like to call written words), dates and times, or more exotic stuff. You can’t add a word to a number or multiply a date.

But in SQL these break down into seemingly endless subtypes: For a number you need to know what the base is, whether it has a decimal point, if it’s positive or negative. With words it matters what the language is so that the right characters are used, plus you need to know what alphabetical order is for those characters, whether case is significant and so on. Dates and times are available in a mind-bending range of formats, depending on, say, whether you’re more interested in events since 1,000 AD or 1970.

Where it gets ludicrous is that there are still further subdivisions, into units of different size. (My favourite is called the Binary Large Object – or for short, BLOB.) The idea was to set aside only as much space as your data is going to need. If you have a column wide enough for six-figure sums and then enter numbers in the hundreds, you’re effectively saving blank decimal places to your hard disk. In the ’70s, disks were expensive. There was no room for empty space.

Compared to this, PHP seems like it was invented by hippoes. (I meant to say hippies there but I’m going to leave the typo in.) It’s just so… relaxed, skipping lightly over the very things that make SQL tedious. It seems to just guess what your data type ought to be. “You’re trying to add a number and a letter together? No problem, let’s see what happens.”

What makes it even more like human language though is the fact that it’s “Object Oriented”. This is a big idea so I’ll leave the details for another post, but suffice it to say that like real nouns, an object in OO programming is meant to represent something in the world. As such it comes with its associated “verbs” (known as methods) that represent the actions characteristic of that object. So the things that exist in your program have hidden powers that you can call upon if you know the right words. Cool.

Perhaps the best comparison then is not with different natural languages, but with different specialised jargon. Moving from SQL to PHP feels a lot like leaving contract law to take up alchemy.

Yes It’s Only A Supermoon

So last night many of you will have seen the biggest moon you ever did see. The “Supermoon” – or perigee-syzygy, to give it its even sillier proper name. Hope you enjoyed it. Despite being sandwiched between lovely days, last night was clouded and rainy here. Sadly I realize that I may not live to see a moon so imperceptibly larger than average as that one. “Almost visibly bigger!” as a FOAF said.

It might have gone largely unremarked, if someone hadn’t speculated that it caused the earthquake and tsunami. This was probably inevitable considering that tsunamis used to be called tidal waves, back when we didn’t know what really caused them. But this is actually quite an interesting idea.

It would be easy to dismiss it with ridicule, what with there being one or two salient differences between liquid water and solid rock. Though it’s enough to leave a very noticeable gap between high and low tide, all the moon’s gravity is really doing is changing the shape of the layer of water that lies on the Earth by the teeniest, tiniest fraction of an iota of a scintilla of a percentage. It’s really a very weak influence.

The Brain, An Owner's Manual - The Moon

But then again – we know the Earth’s crust is a highly complex, unstable system, and we have heard of  the “butterfly effect“, which suggests that small inputs to such systems can lead to vast, unpredictable and – yes – even catastrophic outcomes. So there might be something in it?

Might be. Isn’t though. There’s the small detail that the tsunami happened over a week ago, while the moon was still at a perfectly ordinary distance. Sort of kills the theory, that detail.

The trickier question to answer though is why there isn’t anything in the theory. It doesn’t sound unreasonable. In fact it’s a fine example of an excellent theory that just doesn’t happen to be right. Excellent, because it makes a clear, easily-tested prediction: If the moon’s orbit had any appreciable effect on plate tectonics, there would be a rhythmic pattern to earthquakes. And there isn’t.

If there were, they wouldn’t be so bloody hard to predict.

But why isn’t there…? Well I don’t know. What are asking me for, I’m not a plate tec… nician. But my guess would be that with all that roiling molten rock beneath our feet, with the huge energies of continents weighing billions of tonnes grinding against one another, with the titanic rattling and farting of volcanoes, the moon’s influence is just lost in the mix, drowned by countless stronger forces pushing unpredictably in other directions. Real, yes. But insignificant.

So dwell on that, the next time you stare up into the beautiful night sky. Space may be vast and cold and silent, but hey, you’re standing on a fucking bomb.

More Art, More Science, More Egypt

The Science Gallery
It's This Shape On The Inside Too

I worried I was unfair to Dublin’s Science Gallery so I went back. I’m glad I did, because I was. There is actually a second floor to the place, it was closed because the exhibition was not completely mounted when I wandered in.

I do have my questions about the art on display in the ‘Visceral‘ exhibition, but that’s no bad thing by any means. I urge you to see it for yourself, there’s thought-provoking stuff there. Thought-provoking as in machines guided by rat neurons and bacterial colonies growing into pictures, so it’s well worth arguing over whether it is art, science, or a load of toss. But I’m glad it exists.

But Back To Egypt

Just a couple of hours ago, Egypt swore in the head of the intelligence services as Vice-President. That hardly seems like a move towards a more democratic government, but it may be a way to transition from Mubarak’s rule with the minimum possible fuss.

It could also be seen as the introduction of military dictatorship in all but appearance, with the army’s man rather than a general in uniform taking the helm. It’s inevitable that the military will be power brokers here; just about everything depends on whether they accept the legitimacy of Mubarak’s orders. The next question is whether the military will then support a transition to democracy. There is the possibility that they would simply create a new dictatorship, and tell the people and the rest of the world that we have to support it or the Islamists will take over.

If we accepted that, we’d be betraying the people of Egypt. This is not an uprising in favour of Islamic rule – and certainly, not of military rule. It’s a rejection of oppression, and it’s up to us in democratic countries to demonstrate to the Egyptians that we too are against oppression.

We are, aren’t we?

Science In A Gallery Or Art In A Lab?

Exhibit
Science + Art = Weird Stuff in Jars

So I’m in Dublin’s Science Gallery, a worthy but slightly disappointing project. Passing by, you see it has a cool looking café section jammed into a wedge-shaped window on Pearse Street. That must be part of an interesting place, you think. On going in though, you find that the part is the whole¹.

It has exhibitions, yes. I didn’t warm to the one that’s on right now though. Called Visceral, it uses things out of labs for artistic purposes. Tissue cultures, tubes. It seemed to me less science than cyberpunk. According to blurb, this was “challenging work at the frontier between fine art and biotechnology and forms a series of provocations and puzzles around the nature of the living and non-living”. It sounds like exactly the sort of thing I would find fascinating, but I didn’t even feel particularly intrigued. Possibly I just didn’t find my way into it. I haven’t been in much of a mood to explore the interface between art and biotechnology since I quit drinking.

Maybe the disappointment of the place itself put me into a negative mood. I feel like I should be in favour of the thing, it’s just… The title ‘Science Gallery’ had me expecting more. A science museum of sorts, I suppose. Wonders.

Transparent Horse
Horse Inside

What must be said for it though is that it has probably the best gift shop in Ireland. The perfect place to find an unusual present. What do you give to the person who has everything? A transparent horse, of course. Other lovely things included magnetic tape that actually is tape that’s magnetic, Rubik’s cube salt and pepper mills, and great books including a healthy pile of Ben Goldacre’s Bad Science.

Also it’s one of the rare stockists of Sugru, the multi-purpose polymer beloved of “makers” and other hardware-hacking types. It’s a silicon-based substance that can be moulded to any shape, will adhere to many smooth surfaces, and sets with the texture of tough but yielding rubber. That makes it particularly suitable for human interface things. The name comes from an Irish word for “play”, and I can’t wait to start playing with it myself. My portable hard drive is about to become rugged. And weird-lookin’.

  1. I was quite wrong about this – see here.

Is Climate Change, Bitches

After the breakneck pace of events yesterday, I think a change of topic is in order. Though not without noting in passing how Lenihan attempted to shift blame for the bankers’ bonuses onto Fine Gael and Labour this morning. Suddenly, taxing them is an idea he was all in favour of – but alas his hands are tied by the pesky opposition. There’s no shame in this game.

Microcos Climate CartoonGoing back to Sunday’s tirade against the Greens though: I think it’s probably necessary these days, with the rise of “climate scepticism”, to clarify that I am not on the anti-environmental fringe. I don’t know if I’d call myself an environmentalist. I try to avoid labels that end in “ist”, especially in “mentalist”. But I have friends who are Green Party members – well, until Sunday I had – and I agree with a lot of what they think.

There are extremes of environmentalism I find abhorrent; the “Humans are the worst animal ever and the planet would be better if we all died” lobby. There is a bizarre narcissism to that. How can we be worse than Nature? We’re not supernatural beings. What we are, what we do, is an expression of Nature. We do ugly things, as does Nature. The one difference: We know that they’re ugly.

But I think it is wise to try to upset the dynamics of the planet as little as we can. We should care about biological diversity and stability, we should care about the long-term effects of our activities. This seems the moral, responsible thing to do.

And so there is a movement to shirk off that responsibility. They call themselves sceptics, in much the same way that people who want to promote religion over science use the disingenuous label “intelligent design”. More normally, sceptics are people who point out how widely-held personal beliefs are not compatible with scientific knowledge. These people point out how widely-held scientific knowledge is not compatible with their personal beliefs.

The belief in this case seems to be a sort of libertarianism. To these people, climate change is a hoax perpetrated against them by lefty government, an attempt to force a collectivized tyranny onto freedom-loving individuals. The freedom they seem to particularly love is the one to use up oil like nobody’s business.

Last night the UK’s Horizon did an interesting documentary on the fact that professional science is losing the battle against amateur bollocks. The programme had its faults – it kinda forgot to mention that there might be rational grounds to reject GM crops, for one – but it made the point well that we now live in a world full of people who, when faced with the conclusions reached by thousands of dedicated professionals doing decades of gruelling, intricate research, will say “Yes but here’s what I think”.

So here’s what I think: I won’t disagree that there can be a certain irritating piety to “environmental awareness”. I won’t say that political solutions to these problems are never wrong. But the science on the issue is overwhelming. There is little debate about this in the relevant fields today because that debate has been had already. It was pretty much settled more than twenty years ago. The evidence points to human-driven climate change.

If there is any weak link in the argument, it’s where we extend it into the future and predict disaster. There are a lot of unknowns in the future. However, disaster still seems more likely than not.

So: Most people with actual expertise on the subject think it likely that if we keep behaving as we do it will profoundly change our climate, probably making it far less hospitable to humans, to other animals, and to food production.

We should do something about this perhaps.

It’s not comfortable knowledge. We could rest a lot easier if we were ignorant of the idea that the things we do on an everyday basis could be slowly but inexorably leading to extinctions and floods. Nobody wants that. I understand why some are driven to rebel, to deny that this could be true, even invent great conspiracies of people who have an interest in it being true.

But who has such an interest? If there really is such a thing as a “climate change industry”, it is microscopic when placed next to the other one – industry industry. Faking climate change would be in the interest of a few. Pretending climate change isn’t happening, that would be in the interests of a huge number of people – of very wealthy people.

I know which way I’m betting.