Tuesday, December 23, 2008

Help! Atheists Ate My Planet

One of the interesting things about having an eclectic book habit is that sometimes you read two very different books one after another and find they share some unexpected common thread. The two books in question are China Road (ISBN 978-0-8129-7524-6), in which Rob Gifford makes one last road trip through China, debating with himself whether China is about to take over the world or collapse into chaos, and Mythic Ireland (ISBN 0-500-27872-5), in which Michael Dames takes a scholarly look at the levels of Irish mythmaking.

What on earth can these two books have to do with one another?

The blog title gives it away: both lament the state of the environment and blame atheism for the carnage. This is a bit rich coming from a couple of apparent Christians, whose own holy book contains the exhortations to run roughshod over the planet. Christianity sets up an intrinsic animosity between people and the planet, but only the End-Timer extremists are up-front about it. Still, the fact that the most insistent anti-environmentalists, in the United States at least, are also the most dogmatic Christians can hardly be taken as an accident. The Christian/anti-environmental link is old ground, and well plowed elsewhere.

Dames makes the interesting observation that Ireland has present and active in its culture several distinct overlays arriving in successive waves of migration: Mesolithic (hunter-gatherer) and Neolithic (farmer) goddess worship, Bronze and Iron Age Indo-European sky gods, and Christianity. The Irish tendency to repurpose ancient deities as saints (e.g. Brigit, goddess of the flame) is well known: the bulk of the book is an extended and detailed observation that this repurposing has been going on for a very long time, and that some of the very old (7000-2000 BC) traditions still peek through. All well and good, but then Dames tries to make the claim that "Scientific Rationalism" is just another mythic overlay.
The recent appreciation by Popper and others that 'scientific discovery is akin to explanatory story-telling, to myth-making, and to the poetic imagination' places science in the broad mythic field where, in any case, it was born and nurtured.
Hmm...Right there on page 10, you start wondering just how much nonsense you're going to have to put up with. Well, quite a bit, it turns out, although mainly in small enough doses to keep you going. (Dames has a penchant for listing out every possible ancilliary meaning of a word root to prove mythic points.) Where he really jumps the shark, however, is in trying to make the case that it is the atheistic view of scientific rationalism that is degrading the environment. Dames undermines his own case (in typically overblown BS-laden terms):
Since in all mythologies (including the Christian) the individual is a cosmos-in-miniature, a person divided in two implies an equivalent an equivalent split in the macrocosm. Thus the spirit or soul which previously had been united with the body of the world was driven out, leaving behind a soulless mass of gross matter. Animals, plants, rocks, rivers, clouds, stars, sun and moon, were all now denied their share of the divine vitality. No longer were they regarded as living manifestations of the gods, but as a barrier blocking the view of the abstract and immaterial Godhead. This newly despicable world was repeatedly put to the torch at Lough Derg, and is incinerated again at Hiroshima, and in human-induced global warming. The pilgrimage to Ferry House is an Irish version of the Platonic European walk, where the world, as soulless Thing, is treated with contempt.
This may read like an indictment of Christian ethics and a pining for Neolithic morality, but no, this is not Dames' point at all. He pins dualism on the Greeks and the "mythology" of scientific rationalism. "In time, Christianity incorporated this teaching," he acknowledges (as he must since it is undeniable), but fails to clearly see that separating the divine from nature is a Christian idea, not a Greek one. The distiction between mind and body, spirit and flesh, is a part of the older traditions too. It is Christianity that brought contempt for the non-human parts of creation, not Plato, and not the scientific rationalism.
Let's just set aside completely the non-sequitur of equating science with atheism, atheism with amorality, and amorality with immorality.

In the other corner, Rob Gifford observes the staggering environmental cost of China's development, and again, tries to pin it all on those darned atheists. It is a mess of faulty correlations and (again, sigh I do so get tired of this) the equation of atheism with amorality and immorality, as if they were all the same thing. He finds the blossoming of Christianity and other faiths in China a hopeful sign, but if we want to go for faulty correlations, how about this one: the acceleration of environmental degradation in China correlates with the positive uptake of Christianity. If Chinese are lost for ethical underpinnings, is it because they were raised to praise atheism, or because the Chinese government has made a systematic program of tearing down ethical frameworks one after another over the past fifty years, so that the only sane response is skepticism to any ethical pronouncement from authorities? Gifford runs through the program in detail, and then concludes that Chinese no longer believe anything and therefore (hoo, that's quite a therefore!) their atheism provides their justification for doing anything -- lousy health and safety rules, lousy environmental protection, lousy consumer protections, you name it.

None of it follows, of course.

Why do you have to believe in sky fairies to want to have a clean place for your grandchildren to live? Why does the fundamentally rational position that you can't outstrip your natural resources indefinitely need a supernatural justification for action?

Short answer: you don't.

Wednesday, December 3, 2008

Programming in XML Aware Languages

There is a lively debate going on over at xml-dev about whether XML applications should (or can) be programmed entirely in XML-aware languages such as XQuery and XSLT. As is usual in such matters, "performance" is being called on to fight a proxy war for religious ideals. All the usual positions are being trotted out "higher level language can't do lower level things "efficiently" (although in this case, amusingly enough, there are partizans on both sides claiming their favourite is "higher"), and the old "it depends on what your application is doing" chestnut, to say nothing of "if it's Turing complete, it can do anything" crossing swords with "just because it is theoretically possible doesn't make it efficient". All so very tiresome and predictable. We have been here before, boys and girls, many many many times, all the way back to the days of FORTRAN versus assembly (and indeed soft programming versus hard programming before that).

In the interests of full disclosure I should confess that I work for a purveyor of an XQuery implementation, so you might suppose I have a dog in this hunt. I don't really. I have seen the dark side of both extremes. I have seen the "forget the XML: just get me my objects, quick" meme lead to much wasted effort in trying to get a data-binding layer to stop being the bottleneck of the application and the focus of disproportionate amounts of development effort or expense in evaluating, integrating, and cursing third-party tools. I have seen this several times, in fact, and each time it made me crazy with frustration to spend so much effort on something so utterly pointless to the end goal. One project went so far as to pickle XML into binary object structures for storage, with lots of special code to handle cross-platform incompatibilities in that binary structure, which was then rehydrated as pure XML for shipment to the business logic layer of the application. That said, I have also seen the dark side of the "XML is so cool, let's put it everywhere" meme, the god-awful DOM code to deal with what was, at the end of the day, just a handful of numeric parameter settings. Stupidity burns on both sides of this debate. (Sturgeon's law, I think.)

What I find immensely frustrating about such language wars is that the notion that "performance" is a meaningful and useful criteria to use to judge the quality of a programming language goes largely without question. As Pauli famously remarked: That's not even wrong. Performance is a characteristic of a specific implementation of a specific algorithm in the context of specific data. A bad algorithm is a bad algorithm, in whatever language it is expressed. A good algorithm is good in any language. What often gets missed is: A good algorithm applied in the wrong context is also a bad algorithm. (Folks: friends don't let friends waste a good radix sort on ordering three numbers.)

The only tenuous connection "performance" has to "language" is if the language makes it easier to produce a better implementation of an algorithm for the data at hand. Often, "language" here means "readily available, high-quality libraries".

I once saw a very concrete example of this. There was some code written in language X to do some specialized HTML parsing. It was then ported to language Y, which was, in the language ways de jour, supposedly many times slower than language X. Turns out, however, that the ported code ran several times faster. Puzzlement from the local language X partizans ensued. The reason was not too hard to fathom, however: it was just so much easier to write a better algorithm in language Y given the libraries it had on hand that we did. We could have done so in language X, certainly, but no one ever did, because it was too much effort.

Which is to say, it is human efficiency that is at stake most directly here, not computer cycles. Here it all runs into psychology and a great deal of baby-duck imprinting frequently gets in the way: I have always constructed my algorithms in such-and-such a fashion, therefore such-and-such a fashion is the better way to construct algorithms. (The prevalence of such a attitude is example #463 of why software engineering isn't actually an engineering profession. Here is another.)

Programming may be the last bastion for the Sapir-Whorf hypothesis, but with the wonderful realization that we aren't stuck with one native tongue. We get to pick which language suits the task at hand, which gets us back full circle to the debate: some applications are well-suited to being done entirely in a language with XML concerns as a primary organizing principle, and some aren't. Pick the right one for the right task. Or, as my son would say Don't Be Dumb.