Quick, computer. Do something useful.

I’ve been doing research for a new post on scripting with data, and my favorite find today was this picture lifted from a presentation on subtext.

On one side of the image: a programmer working hard to figure out what the heck all that code does. On the other side: a computer sitting idle, doing nothing but displaying text.
So. True.

I’ve long wondered why it is we insist on storing our code in unstructured text documents. ( I hope Google Script doesn’t use raw text behind the scenes, but probably it does. )

The main rationales seem to be: diff, versioning, portability between tools, and the ability to store… well… jibberish.

The ability to store random text in a file – even incorrect program code – is interesting because sometimes programs don’t compile, and that’s okay. Can incorrect code be stored in a structured way? Assuming it did, now that it’s the year 2013, perhaps we could stick images and diagrams directly into code. Additionally, comments are nice, but real metadata – not just doxygen or javadoc markup – would be really cool. As far as diff and versioning go: I’d be at least interested to see whether history of the sort photoshop, gimp, wikipedia, or google docs provides – data which lets me see what a user did to change something, and not just the end result – could replace diff satisfactorily. The portability of text is hard to beat, for sure. Is that really raw text’s one killer feature?

Blizzard’s trigger editor

At any rate, subtext. It’s interesting. In some ways it’s similar to systems like Blizzard’s trigger editor, Playmaker or Kismet event editing, or Edith for The Sims. It goes further, though, changing the look of code into decision tables, and schematic function calls.

I’m doubtful of any programming environment that forces me to use a mouse, and I’m curious how subtext’s concept of “always executing” ( which was inspired by automatic spreadsheet calculations ) would map to concepts like “distance between NPC and it’s target”, but it’s a thought provoking language.

The Subtext editor