Rowan's World, et Cetera

Towards a consistent PHP type checking system

by Rowan on 16 October, 2016

For most of its life, PHP has been a “weakly” typed language: values can freely shift from one state to another, and mould themselves to what an operation requires; or, in the case of objects, largely duck-typed: you don’t need a formal contract to call a method. There is, however, a trend in the language to adopt stronger typing constraints, first in function parameters, and now elsewhere in the language. As with so much in PHP, this is being done piecemeal, and without a clear road map. This is partly deliberate: a gentle introduction of optional features is less disruptive; but it is dangerous: compromises made now will shape the language for years to come.

I think it is time to grasp the nettle and say that there is a definite policy of introducing a new typing model to PHP, and a roadmap of what that means for the language. The implementation may still be incremental, but each change will be a step in a consistent direction. This post is my musings on what such a model might look like.

(more →)

Voting reform won’t stop us getting an answer we don’t like

by Rowan on 10 May, 2015

Although I’ve thought about it for a long time, I find myself increasingly unsure about electoral reform, and questioning much of what is being said after Thursday’s election. I’m certainly no fan of the current system, with its awkward patchwork of safe seats and local tactical battles; and I’m distinctly unhappy to see the Tories handed the power to implement some really damaging policies; but I’m not sure the two things are really connected, or what a better system would actually look like.

(more →)

Is Facebook a community, and other pressing issues of social governance

by Rowan on 12 October, 2014

I’ve long been fascinated by the social challenges of online communities, and how they mirror and differ from “real life” societies. I was recently pondering this with regards the Facebook “real names” policy, and whether it was necessary, or at least reasonable, for them to assert that level of control. Then I was reading about the #GamerGate situation, and ran into similar thoughts about the necessity, and the perils, of policing online spaces.

(more →)

Losing our way in the tapestry of religious debate

by Rowan on 19 April, 2014

We live in a time where there is a lot of debate about religion – is it a force for good, or for bad? Is belief in a supreme being fundamentally less enlightened than acceptance of the scientific consensus? And so on. But a lot of the arguments on both sides are poorly thought through, and make fundamental errors of logic, or simply overstate their case to get attention. I think a large part of the reason for this is that “religion” covers such a complex tapestry of ideas, that arguments that start following one thread in that tapestry get snarled up in other parts, where the original argument no longer makes sense.

(more →)

Securely Importing and Exporting CSV with PostgreSQL

by Rowan on 16 February, 2014

Many moons ago, I posted a surprisingly popular answer on StackOverflow regarding how to write to CSV files using PostgreSQL. The answer, in a nutshell, is the COPY statement. But there’s a catch – PostgreSQL imposes strict security limitations on the use of this statement, which are best dealt with using another feature, the SECURITY DEFINER option to CREATE FUNCTION. Here, I will attempt to explain in more detail what these security restrictions are, and how to do what you want without simply disabling that security.

(more →)

Reasons to support same-sex marriage – the short version!

by Rowan on 10 July, 2012

I’m quite pleased with my blog post about why legalising same-sex marriage is the only logical option. It took me ages to finish, and I think it’s quite thorough. But at over three thousand words long, it’s not exactly bite-sized!

So here I present its boiled down essence, in the form of an imaginary dialog1. It follows the same order as the original post, so if you want the details on any of these points, please look over there before arguing with them.
(more →)


  1. and using my favourite under-used HTML element, the definition list 8) []

Why legalising same-sex marriage is the only logical option

by Rowan on 8 July, 2012

Ever since a friend posted a quote on Facebook from this article about same-sex marriage by Archbishop John Sentamu, I’ve had a lengthy analysis and response drifting through my mind. The government consultation ended on the 14th of June, and they’ve indicated they intend to press ahead with legalisation, but the debate is still very much alive. To my mind, equalisation of marriage seems entirely sensible, and those objections to it not based on outright prejudice are missing some crucial logical point. This is obviously just my opinion, but I’m going to attempt to back it up with some thorough logical analysis below.

(more →)

REAMDE: A Review

by Rowan on 27 November, 2011

For my birthday, my sister’s fianc√© gallantly lugged all the way from California a pre-publication copy of Neal Stephenson’s latest novel, “REAMDE”. At just short of a thousand pages, it must have taken a fair chunk of his luggage allowance, and like a 3-hour movie, you can’t help but feel that a book that long might have benefited from a stricter editor. Certainly, Stephenson’s love of technical detail, and tendency to throw all his ideas into one pot, is very much in evidence. And yet I found myself utterly unable to put it down all the way through.
(more →)

Cached Redirects Considered Harmful (and how browsers can fix them)

by Rowan on 9 October, 2011

There are a lot of URLs out there on the Web; and a pretty big number of those URLs are either alternative names for something, or old locations that have been superseded. So “redirects” from one URL to another are a common feature of the web, and have been for many years. But recently, the way these redirects behave has been changing, because performance-conscious browser developers have started caching redirects, rather than re-requesting them from the server every time.

In theory, this makes perfect sense, but in practice, it causes web developers like me a lot of pain, because nothing “permanent” is actually that¬†permanent. I’m not saying no browser should ever cache a redirect, but I do have a few suggestions of ways they could be a little more helpful about it.
(more →)