Month: May 2011

The story of “Semantic”

In the beginning was HTML, and the version of the HTML was 4, and the quality of the HTML was madness. And some people, some wise people, said “This is madness”.

They were right.

So they sought a path out of madness. They said, “this thing we have marked up as red and bold, we did that because we considered that to be important. And this thing we gave a background color because it’s the heading.” And so the things that were headings, they labeled as headings; and the things that were important, they labeled as important, and these labelings they called semantic.

And they were right to do so.

We said, then, that since we liked to avoid madness, we would call all things by their semantic names. And then we had a project with three headers and two sidebars, and we gave them all increasingly strained names, and then the designers gave us a box which was to hold the names of fribbles and the addresses of frobbles. And we asked ourselves: what, semantically, do fribble’s names and frobble’s addresses have in common? And the answer to that was, sadly, sweet fanny adams.

Yeah.

Sweet Fanny Adams.

It turns out that sometimes, a box on the side below the other box on the side, is just a box on the side below the other box on the side.

But we had trained ourselves to ask not just what things were, but what they were semantically. And we had forgotten that the semantics of a thing are nothing more or less than the meaning of the thing. And then when things were nothing more or less than a box on the side. we were paralyzed by trying to find a deeper meaning for the box on the side; we were too busy looking for the semantics of the thing, to let the thing simply be what it was.

And that is why the word “Semantic” makes me sad.

Statements about software development

Some of these, I may write more about. I often feel like these statements between them point in a direction, and some days I think that I could build something that they’re pointing at. Maybe I’ll just keep complaining, though!

  • A database is just a big ol’ global variable.
  • Mutable state is where bugs come from.
  • Uncontrolled side effects mean you may as well have mutable state everywhere.
  • Does your application’s database contain a stream of data, or a pile of facts? We think of it as a pile of facts, even when it’s a stream of data. We should stop doing that.
  • Your tests should only assert things that you actually care about.
  • Mocks in a dynamic language are almost unforgivable.
  • A relationship between two objects, doesn’t belong to either of them.
  • A picture does not describe a user experience.
  • Building pages in terms of html and then dealing with them in terms of DOM is stupid.
  • Why wouldn’t you want your language to stop you from putting round things in square holes?

ICFP Programming Contest, 2007

So, that was a while ago… http://save-endo.cs.uu.nl/ is the website.

I participated in it with a bunch of friends, but we never managed a particularly good implementation of the basic spec. We were able to render the starting image – in something like 4 hours. Anyway, the thing opens up into a scavenger hunt, of sorts, and I got tantalizing glimpses of that hunt but our implementation never let us get anywhere. I’ve recently picked the thing up again, resulting in something that renders the starting image in about 3 minutes (so far). It’s on github: https://github.com/imccoy/icfp07

It’s the most non-trivial thing I’ve ever written in haskell. As it turned out, getting it working and correct was not particularly hard (incidentally, finger trees rock), but I have had a bugger of a time getting rid of the space leaks so that the thing could actually run to completion. That makes haskell an interesting contradiction, for me: I love the way it’s type system and purity conspire to prevent surprises, but I hate the way it’s laziness creates more surprises.

I imagine I’ll keep poking at it, both in terms of optimizing the implementation further and trying to find more of the stuff they’ve hidden away in there.

The Slap

by Christos Tsiolkas – I finished reading it last night, and found it quite remarkable. Too many sex scenes, and too many four letter words starting with C, but I was beguiled by the portrait of a family making choices, making bad choices, as everyone does. To have such sympathy for these characters, even as we are presented with the horror of their darkest selves, is striking.

That their humanity was so tied up in the best and worst of themselves was, to me, quite beautiful.

I think maybe the next book I read will be one where some of the characters are not arseholes, though.