This page has moved. Update your links to: http://www.nedbatchelder.com/blog/index.html

[*]
Ned Batchelder
Weblog
» Home

Obfuscated Code

Tuesday 13 August 2002 (¤)

The annual 5K Contest has announced its winners. The contest calls for web content totalling less than 5120 bytes, but still does something compelling. The tagline of the contest is "An award for excellence in web design and production", and I suppose it is that, but by imposing strict size constraints (as a way of challenging the entrant) it has also morphed into that time-honored coder's tradition: the obfuscated code contest.

The original (or at least longest-running) obfuscated code contest is the International Obfuscated C Code Contest. It started because of the reputation C had for being unreadable in the first place, and because of the fun of trying to make it even more unreadable.

In 1993, in the same ironic spirit, one Obfuscated PostScript contest was held. I was lucky enough to win a second prize with my square-dance entry, an example of a parquet deformation (an Escher-like geometric construct, popularized by Douglas Hofstadter in his book Metamagical Themas):

output of square-dance.ps

Because the Obfuscated PostScript results don't have a nice home like the C contest, I've made them available here in one zip file.

(react)

Edsger W. Dijkstra: 1930-2002

Thursday 8 August 2002 (¤)

The pioneering software giant Edsger W. Dijkstra died this week. His career focused primarily on the process of writing programs, and how to make the process (and the programs) better. He was the type of thinker who could set out on his own course and create an entire field of study in his wake.

He kept a running list of his works over his forty-year career, sequentially numbering everything he thought others might be interested in. Initially, these papers were photocopied and passed along. In a quaint historical touch, even his latest entries are handwritten (and his handwriting was classy enough and widely-enough distributed that it inspired a digital font).

His best-known work is quite short: Go-to Statement Considered Harmful. The impact of this letter was remarkable: in 1968, it wasn't possible to write programs without GOTOs. An ordinary coder who suggested that you try would have been thought crazy, and if someone had attempted it, it would have been a stunt: the coding equivalent of stuffing twenty college students into a phone booth.

But Dijkstra was right, and now no serious programmer can imagine it any other way. Giant software projects are constructed without a single GOTO. Many programming languages don't even have the concept. Even the title of his letter is a classic: "{something} Considered Harmful" is a meme unto itself, and has been often-used to evoke the ground-breaking insight of Dijkstra's work, even if sometimes in jest. (Actually, it turns out that he didn't write the title: ironically enough, Considered Harmful: The Weblog has the story.)

He wrote many other things over the years. The earliest English entry in his list of work (a review of the IBM 1620 computer) provided this insightful conclusion:

The next fact that we have to face is that this machine, despite of its poor qualities, has been produced, in this case even by a big firm with a long and considerable experience. The straightforward conclusion is, that nor the size nor the experience is a guarantee as far as the quality of the product is concerned. Well, we can think of various explanations for this apparent inconsistency, but the most obvious explanation predicts still more blunders in the more ambitious and more complicated products of the manufacturer in question.
(react)

(via: Python owns us)

Errorwear

Tuesday 6 August 2002 (¤)

errorwear makes t-shirts imprinted with various error messages on them. These are hip and clever in a straight-forward sort of way. We computer geeks live with these messages all day every day. Embracing them and printing them on t-shirts is a brilliant form of asserting our power over these thorns in our side.

I particularly like the broken image icon shirt, which is almost Magritte-like in its play on the entire concept of what it means to be a t-shirt with an image on it.

(react)

(via: Dive into Mark)

Junkbot

Sunday 4 August 2002 (¤)

I don't usually find much redeeming in the "games" on commercial websites. They are usually tired rehashings of the same old games, but with the brand's cartoon characters dropped into it.

The games at Lego are different though. They seem to have put a great deal of thought and work into them. A particular favorite is Junkbot. It reminds me of Lode Runner, the classic timed puzzle game with hundreds of levels.

My son has played all of the Junkbot levels, and I can understand why: they are puzzles, they take place in a Lego-themed world, and it's all in good fun. You have to move Lego pieces around to get Junkbot to the garbage he devours, while avoiding pitfalls. The variety of pitfalls increases as the levels continue, so that by the end, there are blocks that destroy you, blocks that make you invincible, blocks that enable or disable other blocks, blocks that move you against your will, and so on and so on. Imaginative, challenging, creative, witty, fun. Play it.

Junkbot

(react)

Google Groups ASCII Art

Friday 2 August 2002 (¤)

This is one of those clever hacks that puts smiles on geeks faces, and makes the round for a few weeks, then disappears to be replaced by the next clever hack. But I am a geek, and it put a smile on my face, so I present it to you.

Taking advantage of Google Groups' color-highlighting of search results, "artistic" geeks have produced color ASCII art in plain-text newsgroup postings. Poke around in the thread to find more.

My favorite:

Bart Simpson ASCII art

(react)

(via: Boing Boing)

High-Performance Server Architecture

Friday 2 August 2002 (¤)

Jeff Darcy has written a quick synopsis of things to do right when designing servers to get them to perform well: High-Performance Server Architecture. It's a quick overview for experienced coders, and covers the important parts. Good reading.

(react)

(via: Canned Platypus)

Pixar Shorts

Wednesday 24 July 2002 (¤)

Pixar has put their short films up on their site. These are great little films, made while Pixar was gaining experience with their tools. They are terrific just as shorts to watch, because John Lasseter's storytelling comes through clearly in each one. But they are also interesting as a progression of technology.

(react)

Jim's Big Ego

Monday 22 July 2002 (¤)

Yesterday's post about Stephen Wolfram's ego reminded me of the band Jim's Big Ego.

Jim Infantino is the main guy, and he writes funny catchy hip songs. I particularly like "Stress", with its flash video. My wife used to work with him back when he sold cassettes of his songs. He's a nice guy.

(react)

Stephen Wolfram's Unfortunate Ego

Sunday 21 July 2002 (¤)

I've started reading Stephen Wolfram's landmark book, A New Kind Of Science. Much has already been said about Wolfram's high opinion of himself, and his presentation style. Even knowing these things beforehand, my breath was taken away by the sheer size of Wolfram's ego.

For those who don't know, Wolfram's book is about a new approach to science that is the biggest new direction since Newton, and, according to Wolfram, will be wildly more successful than previous techniques. Whether this is true or not, I cannot say. Presumably reading the whole book will give me some idea, but I don't pretend to ever be able to make that sort of judgement. I'll leave that to others. Perhaps only a century's time will ever tell.

My thoughts keep running to two other geniuses: Isaac Newton (Wolfram's predecessor in revolutionizing science) and Donald Knuth (another contemporary computer scientist). Like Wolfram, both personally produced enormous works that changed the course of their fields. Like Wolfram, both were renowned for their intelligence and wide-ranging work. But both were also gracious and modest, something that Wolfram is not.

Newton's most famous quote is "If I have seen farther than others, it is because I stood on the shoulders of giants". Knuth's writing is as comprehensive and authoritative as Wolfram's, yet has a friendliness and openness that Wolfram seems incapable of.

Wolfram has been criticized for not crediting others for their contributions to the work. Again, I cannot judge whether this is true. What is clear is that a reader of his book would come away with a picture of Wolfram working in isolation for twenty years, and emerging from his cave with an earth-shattering theory fully-formed. On page 12 of his book is a section which presents thumbnail sketches of such fields as Artificial Intelligence, Chaos Theory, Evolution Theory, and Fractal Geometry. The section is called "Past Initiatives", and essentially presents these efforts has having failed. Rather than discuss them as foundations and precursors, he paints them as erroneous dead-ends.

Another blemish is the encouragement to use Mathematica as a tool. Stephen Wolfram wrote Mathematica (again, this is presented as simple fact: I'm sure there were others involved!), and I have no doubt that it is a wonderful tool, even a ground-breaking one. I also have no doubt that it is the best way to experiment with these ideas. But there is something unseemly about stating matter-of-factly that the experiments in the book can be duplicated on a standard computer, while glossing over the fact that the recommended techniques (Mathematica programs) require spending hundreds of dollars to buy the software from his own company. Perhaps there are other ways to experiment? Of course, but Wolfram isn't helping us to discover them.

Should it matter whether Wolfram is gracious and charming? Perhaps in some pure abstract world populated by pure abstract scientists, it should not. But we do not live in such a world. As an ordinary reader of the book, I find it grating and distracting. If I had been one of those whose efforts have been glossed over, I would find it enraging. Writing a book is fundamentally about trying to transmit ideas from the author's mind to the readers'. As I read A New Kind Of Science, it seems there are three main ideas I'm supposed to accept:

  1. Computational processes can provide the underpinnings for science.
  2. Stephen Wolfram is a genius.
  3. I should buy Mathematica.
In a perfect world, idea #1 would be the only idea explicitly encouraged by the book, and ideas #2 and #3 would be natural by-products. Modesty in an author would require text actually countering ideas #2 and #3. Wolfram's style unfortunately makes me question which idea is most important to him. I begin to suspect it is #2, which may hurt the acceptance of #1.

(react)
Older: Fighting Noise
Older: Flaky Coffee Grinder
Older: Mark Fiore Animation
Older: letterscapes
Older: E. B. White on Walden
Older: ILM Short: Work In Progress
Older: Wonderful Animated Type Video
Older: Toward a more accessible blog
Even older...