July 2004

Writing tools for the web

We’ve come so far, and yet, we have so much farther to go.

When I set up my first website, all my HTML coding was manual. Creating a new page meant opening up a copy of an empty web-page template I had created, writing the page, saving it, uploading it by FTP, editing my local copies of any other pages I wanted to link to it, saving them, and uploading them (and any graphics that might be involved). Using Japanese at all was fraught with peril, because there wasn’t a single browser that could handle the three prevailing encoding methods for Japanese (Shift-JIS, New JIS, EUC). There were some primitive web tools that allowed you to edit pages directly on the server via the web browser, but the browser provided a miserable interface, and I didn’t have the cash or the technical chops to install one of these.

Today, we’ve got content-management systems and blogs that handle most of these tasks. Modern browsers have tolerable editing interfaces and are vastly smarter about international characters (and in any case, we’ve got Unicode). Right now I’m typing this in a small program that runs on my computer and talks to my blog’s software to upload my posts.

But some people want more. They want an editing tool that gives them smooth control over HTML and CSS, and somehow gets out of their way to make this all transparent. Something like Microsoft Word for the web. Well, that’s a poor analogy, because Word is terribly intrusive. Like how it goes and creates bulleted lists for you when maybe you don’t want one (unless you go to considerable trouble to get Word to cut it out). Interestingly this kind of thing is considered a useful feature in blogging tools, which may say something about the state of editing tools, or the difficulty of writing HTML. I’m not sure.

Back in the bad old days of personal computing, word-processing for paper output was about as bad as writing HTML is today: you had to type tags or special codes to make text bold, italicized, or centered. With the exception of some hardcore XyWrite enthusiasts, WYSIWYG was acclaimed a great leap forward for word-processors.

So great has been WYSIWYG’s hold on our imagination that it is promoted as a worthy format for web-writing tools. It ain’t. Although my handy-dandy blogging tool will do a tolerable job of wrapping <p> tags around my paragraphs, it can’t do much more than that, so there’s clearly room for improvement. But how do you deal with hyperlinks wizzywiggily? Or the clever abbreviation above, that shows its full expansion when you hover over it (in a decent browser)? There’s no way. HTML is not presentational, it’s structural. You need a way to show the structure of the document as you write. For presentation, we’ve got CSS, which determines the presentation of content for different media: screen, paper, even speech-synthesis. In the land of print, you might have a rule that document titles are always 24-point bold and centered. In the land of HTML, all you know is that a chunk of text tagged as <h1> is at the top of the document hierarchy (and there’s room for dispute on that). That same chunk of text could have completely different forms of presentation because HTML is not tied to any form of output; it contains different forms of meta-data that will often be presented identically (but might be useful to search engines), and contains some that simply isn’t meant to be viewed by humans.

So we’ve got to deal with HTML, content, and CSS. I can imagine a writing program that lays things out like this:

Tag Content CSS
h1 Here is a heading Screen
font-family: helvetica;
color: #600;
font-size: 18px;
Print
font-family: helvetica;
text-align: center;
font-size: 18pt;
p Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent consequat, nibh at aliquam convallis, sem arcu sodales mauris, et sagittis risus wisi ut dolor.. default

Perhaps there would be popup menus in the Tag and CSS columns, or perhaps some intelligent prediction that writers can override (when we get intelligent prediction in the Content column, watch out).

Of course, even this is still too simplistic. In terms of HTML handling, this model is OK for block elements, but does nothing for inline elements. Dealing with nested elements could be tricky. For CSS, it gets very hairy. CSS is complicated: styles can reside in the tag, in the head of the document, and in other documents, all pulled together in different ways. Styles may apply to a tag universally or contextually. So this putative tool would need to analyze the document structure to determine which contextual CSS rules to show. And if the author serves pages dynamically , or uses dynamic includes to assemble a page from multiple fragments (as I do), it will need to take that into account.

I don’t see an easy way out. A program that is easy to use and allows fine-grained control and generates smart, well-formed HTML and CSS will be a serious challenge for interface designers and coders.

The Story of the Weeping Camel

Saw The Story of the Weeping Camel with Gwen last night. This is the first Mongolian movie I’ve ever seen (unless you count Genghis Blues, which I don’t). It’s not clear whether this is a documentary or a work of fiction that just happens to be made with real events and real people who are basically being themselves. Subtitling was very minimal, telling just enough to keep the audience from getting confused.

It’s a slow-moving movie. Not much happens, and the things that do happen are small things. But it gives you a feel for what it must be like as a nomadic camel-herder living in the Gobi Desert. It’s astoundingly bleak: it’s hard to imagine that there’s enough vegetation to support the goats and camels in the flock, and it’s hard to understand how human beings came to inhabit that part of the world. But the people don’t seem to have bitter lives, or much desire to do anything different.

At one point a couple of boys head out to the nearest town; Gwen and I just looked at each other and asked “what do they steer by?”

More on music storage

Some time ago, I wrote an essay on music storage options (mostly on how bad they are).

We’re at a point today where even a big music library–say, 1,000 CDs–can be easily archived on a single hard drive using high-quality MP3s–say, 192 Kbps encoding. Some people claim this encoding rate is indistinguishable from CDs; others claim it’s barely adequate for listening. Whatever. It sounds good to me. In any case, at this rate, one hour of music is encoded as about 83 MB, meaning that 1,000 CDs (which are usually somewhat under an hour) will fit onto the 160 GB hard drives that are now available (as bare mechanisms) for under $100, with plenty of room to spare.

Purists will argue that lossy encoding is a bad compromise. We don’t need to use lossy encoding–a lossless format called Shorten has been around for years, and Apple’s iTunes now comes with something called “Apple Lossless Encoding.” These can shrink a CD’s data down to a little less than half its original size, meaning about 250 MB for one hour of music. The fact that ALE is built into iTunes means you have a nice interface for dealing with these tracks (as opposed to the more arcane software required to deal with Shorten files), making lossless encoding a practical option. I have no idea if there are converters that recode ALE as Shorten to avoid lock-in.

Anyhow, at that rate, it would take three 160-GB hard drives (and some kind of enclosure) to store a 1,000-CD music collection, but assuming Moore’s Law holds, in a few years, we’ll be back at the $100 mark.

Smaller MP3s still have their uses, though: If you have an in-car MP3 player that reads MP3 CDs, you’ll still need to recode your lossless files to MP3 in order to take advantage of it. If you have a portable MP3 player for jogging, likewise (though if you splash out on an iPod, you won’t need to bother).

Before Sunrise

In 1995 (was it really that long ago?), Richard Linklater made Before Sunrise, where two young people, Jesse and Celine, meet and spend a night in Vienna, having a “My Dinner with Andre” — style rambling conversation. They agree to meet six months later at the same train station where they separate.

I always wondered what happened to them. In Waking Life, there’s a segment showing Ethan Hawke and Julie Delpy (who played the characters in Before Sunrise) in bed together. When I saw that, I thought that it answered the question in an oblique way.

Apparently not. Before Sunset answers the question directly. It’s another two-person gabfest, this time in Paris. The movie almost feels like it was filmed in a single shot–the conversation almost never pauses, and it does have some very long shots (something you don’t see much anymore). I especially liked one that wound up up up a staircase.

The story is bittersweet and wonderful, and like it’s predecessor, ends without answering its big question.


Tangent: in finding links for this entry, I discovered that there was a movie titled My Dinner with Andre the Giant. It strikes me as funny that Wally Shawn, who was in My Dinner with Andre, starred in a movie with Andre the Giant, one of my favorites, The Princess Bride. If anybody should have made My Dinner with Andre the Giant, it’s him, but Andre the Giant is no longer with us.

Spider-Man 2

Saw Spider-Man 2. It’s as good as they’re saying–not just good as comic-book movies go, but good as movies go in general. The special effects don’t dominate the movie, but they’re damned entertaining.

Doc Ock’s tentacles are pure genius–good enough that I didn’t bother asking myself “how’d they do that?” and just enjoyed the effect.

Who hates what?

It has almost gotten to be a joke: a progressive criticizes G.W or one of his policies, and a conservative fires back “Why do you hate America.” (It’s gotten to the point where it may be more likely to be another progressive asking the accusatory question, except in jest.)

This is a neat trick for changing the terms of the debate–rather than answering the criticism, you put the critic on the defensive by questioning his patriotism–but it is also evidence of a kind of dangerous L’état, c’est moi, or more accurately, L’état, c’est lui kind of thinking, which I thought went out of fashion with Louis XIV. Who knew the Republicans were such Francophiles?

Ten years

Looking through some old e-mail, I just discovered that I’ve had the “crossroads.net” domain name, and this e-mail address, for exactly ten years as of a few days ago.

Firedancing goes uptown

If you have plenty of money and fancy yourself a bit of an enthusiast for some activity–any activity–there’s a luxury tour to accommodate you. You go to some wonderful location, you stay in a nice place, do some sightseeing, eat a lot of really great food, and oh yes, indulge in a little bit of that activity.

It seems this phenomenon has come to firedancing: I just got a piece of e-mail advertising what can only be considered a luxury firedancing tour. In Florence, Italy. I don’t know what to think. I’m sure that whoever participates will have a great time, but whoever is going to participate? For the most part, firedancing appeals to people who don’t have that kind of money to throw around. And I have…conflicted emotions when I consider the people who do have that kind of money and want to spend it on this kind of tour getting into firedancing.

Simultaneous invention

Liebniz and Newton invented the calculus at roughly the same time.

Alexander Graham Bell and Elisha Gray both invented the telephone at the same time, and filed with the patent office a few hours apart.

While it takes smart and insightful people to make these things happen, inventions are also the product of their time, and of other trends that are more or less well-known. Often the invention is a matter of recombining existing technologies in a novel way.

Apple’s recent demo of Tiger got a lot of people thinking “gosh, Dashboard looks an awful lot like Konfabulator. Apple must have ripped off those Konfabulator guys.”

This created a stir on Mac sites, with some claiming it’s a ripoff, some suggesting that the gracious thing for Apple to do would at least be to compensate the Konfab people for pulling the rug out from underneath them, and others pointing out that in fact, there was plenty of prior art to Konfabulator. John Gruber, astute as usual, pointed out that Apple in fact is not ripping off much of anything.

What do all these things do? They give you a simple way to script mini-applications–both Dashboard and Konfab use Javascript–and a method for skinning them. Konfabulator uses a somewhat unfriendly XML format; Dashboard uses straight HTML/CSS, but the two are pretty similar.

Here’s the thing: neither one is even a little bit original. Mozilla uses this idea already: it has a markup language called XUL for painting the browser’s “chrome,” and Microsoft is working on it’s own version of this, XAML. These use javascript to build application interfaces and javascript to handle user interactions. Gosh, that sounds familiar. In fact, when MS announced XAML, there was some hand-wringing a while back over how it was ripping off XUL.

Ideas like skinning, making scripting more accessible to more people, using standard markup languages to generate interfaces, etc, are ideas whose times have all come in the computing world. Lightbulbs lit up over lot of people’s heads, and they combined these ideas in similar ways. Konfabulator clearly beat Dashboard to market (though I find the product all-but unusable), but it is original only in the sense that its creators had the idea on their own (if in fact that is so), not in the sense that its creators are the only ones to have the idea.

Fahrenheit 9/11

Though we planned on seeing Supersize Me, Gwen and I arrived at the theater a few minutes late, so we decided to catch Fahrenheit 9/11 instead. Not exactly the feel-good movie of the summer, we both walked out silently and barely said a word on the way home. There was very little in the movie that was news (though the bits about James Bath were interesting), but the impression they make when taken together is one of horror.

Anything Michael Moore does is automatically controversial, if for no other reason than he’s the one doing it. That said, I suppose there’s plenty to take issue with in the movie, but still, it’s very strong.

There are facts and there are stories. Moore uses facts as building-blocks for stories, and he’s clear about where he’s troweling in the mortar of speculation to make them hang together. Critics can and should fact-check Moore’s ass, and Moore knows that: he’s pretty meticulous about backing up his facts. And critics can take issue with the edifice he’s constructed. But the building-blocks fall into place pretty snugly in this movie without a lot of mortar to hold them there. That says a lot.