This Hack Was Not Properly Planned

by why the lucky stiff

Nikolai Krylenko: We must finish once and for all with the neutrality of chess. We must condemn once and for all the formula ‘chess for the sake of chess’, like the formula ‘art for art’s sake’. We must organize shockbrigades of chess-players, and begin immediate realization of a Five-Year Plan for chess.

I can also recommend this harrowing list of chess problemists who died or were imprisoned during this era in Russian history. It’s as if the lines between actual war and the game were blurred: chess became too real and imprisonment became too strategic.

And you can see where it all came from. Here Krylenko was living in Switzerland splitting his time between chess games with Lenin and plotting with the Bolsheviks to overthrow the czar. I’m not suggesting that chess fed his combativeness (though, in a steampunk world, Columbine would have been pachinko’s fault,) no no hardly, it seems quite the opposite is true, that Krylenko’s warmongering spilled over on to the checkerboard. We must finish once and for all the neutrality of chess!

But, you know, I think it’d be a much, uhh, greater stretch for a programmer to twist hacking into a battleground. Yeah, sure, there’s War Games, but writing code isn’t a simulacrum for war like chess is. Subverting the authority is totally inherent to hacking. Rather than attacking a fixed opponent, one who is clearly sitting across from you and obviously masked under the inverted color to yours, the novice hacker introduces volatile code into the pristine (or supposedly pristine) empire of the operating system (the “establishment”.)

Try to tap into any of the initial fear you felt while programming. Will this work? Is this dangerous? And the computer rejecting your advances with error after error.

Perhaps this is why I have trouble swallowing unit testing or extreme programming or other best practices as the law. I guess there’s a place for these tricks (the work place,) but they do not speak to the pure form of hacking for hacking’s sake, which I so ardently defend! Unit testing, in particular, is designed to reel in spontaneous hacking. It is like framing a picture before it has been painted. Hacking, at heart, will continue to be something of spontaneous order, something of anarchy, and the landscape of hacking is something which comes from human action but is not of human design.


Here, I’ll give you an example. Right now the term Programmer implies employment. There is the rare Con Kolivas, who worked as a doctor while he did Linux kernel stuff, but we’re already calling him a Doctor now, aren’t we? Yet, the very marketplace that has vacuumed up all the Programmers has prevented to stop those Programmers from devaluing the monetary value of software and shrinking certain markets in their spare time. Free software burst at the seams. With seemingly spontaneous combustion. Did the Doctors do this to their industry?

You could blame Stallman, but I just don’t think that gives entropy enough credit.

I really think chaos is an essential component of writing code. The system is too big for you to fathom. So you are always finding yourself in unfamiliar territory. And once you fathom the system, it becomes too boring and tedious to pay attention to details.

But you do not really fathom the system! Not all of it. You’re just ignoring the chaos. Think of the variety of platforms and the complexity of each of them, each with millions of unseen bugs and undocumented avenues. And the constant need to relearn strategies which have become outdated or which you learned incorrectly in the first place. Think of how much code you already pinch from other programmers, of which you only really understand the soldering points.

Oh, and I don’t really pretend to really know what I’m talking about, I just know that I will randomly say the right thing. When defending chaos… anything goes! (At any rate, my audience is so small, it doesn’t matter, does it?)


Which brings me to batsman’s 5-line wiki, which some of this small audience might recognize:

#!/usr/bin/ruby -rcgi
H,B=%w'HomePage w7.cgi?n=%s';c=CGI.new'html4';n,d=c['n']!=''?c['n']:H,c['d'];t=`xx
cat #{n}`;d!=''&&`echo #{t=CGI.escapeHTML(d)} >#{n}`;c.instance_eval{out{h1{n}+
a(B%H){H}+pre{t.gsub(/([A-Z]\w+){2}/){a(B%$&){$&}}}+form("get"){textarea('d'){t
}+hidden('n',n)+submit}}}

Whenever obfuscated code was posted on RedHanded, you could guarantee a reaction like that of dustin in the comments: “5 lines? With Error checking?” Otherwise known as: Humpfh, good sirs, this code is not maintainable! And which also rears its head as: This is exactly what I hate about Ruby! This code makes me want to shoot myself! Host rejects graft! Brain rejects brain poisons! The Serious Skeleton Has Emerged From His Crypt Of Contemplation And He Has No Funny Bones For You!

Come on now, kids, enough with the invasion of the serious, this code is a classic relic of Mauricio Fernandez. This code goes right in my museum. And don’t put it behind glass, because I want you to go right up and see it unfiltered. It’s an audacious and plundering and wonderfully disastrous bit of code. All in five lines. And it works! It’s actually a real wiki!

This hack communicates so many things. I mean it’s five lines, but the first line is a she-bang. Yet he counts it because it uses Ruby’s dash-r switch to require the cgi library. That line itself mocks how arbitrary the 5 is. Clearly this code is littered with UNIX-isms, between the she-bang and the various backticks. He’s literally filling this thing with taboos to put you off, as if obfuscation wasn’t alienating enough.

I mean the line where he’s using echo to stuff the escaped HTML into a file doesn’t really save many characters, it’s just there to pull your chain.

And why exactly wouldn’t programmers want their chains pulled? Surely programmers must have the longest and sturdiest and clankiest chains in the biz. They said so on the mailing list. Is getting your chain pulled CONSIDERED HARMFUL? Ohhhhh no!

But here I quote from Edsger Dijkstra, the father of CONSIDERED HARMFUL, who once said:

Two opinions about programming date from those days. I mention them now, I shall return to them later. The one opinion was that a really competent programmer should be puzzle-minded and very fond of clever tricks; the other opinon was that programming was nothing more than optimizing the efficiency of the computational process, in one direction or the other.

Two opinions, eh? One must be correct! And I, Edsger Dijkstra, will decide! We must finish with the neutrality of programming once and for all! We must organize shockbrigades of programmers, and begin immediate realization of a Five-Year Plan for programming!


From the same essay, his popular saying:

The competent programmer is fully aware of the limited size of his own skull. He therefore approaches his task with full humility, and avoids clever tricks like the plague.

So it’s all hogwash. The very thing which draws you to programming is your undoing. Unless you are it’s undoing. I hate you, Edsger Dijkstra!

Lastly, I’ll just quote myself, in the tail recursive form, something I said on December 24th, here, in this very story, at the end of a truly terrible tale:

Far too many chess players have died for us to stop hacking for hack’s sake.