Tuesday, April 20, 2010

Data or Code?

There has been much ado about Apple's decision to yank Scratch from the app store.  The timing has led many to believe that this was precipitated by the much-maligned iPhone OS 4.0 SDK developer agreement change that forbids alternative development languages/environments.  However, things like interpreters, executable plugins, and virtual machines have been explicitly forbidden by the developer agreement at least as far back as March 2008.

I am forced to wonder: Were the guys that developed the iPhone port of Scratch unaware of these rules, or were they simply hoping that -- given that Apple was founded on the ingenuity of two young guys in their garage -- maybe, just maybe someone there would think making creative software development tools for kids was worth making some kind of exception for.  One of the guys behind the project posited that "Basically, Apple hates us."  No, man, what you experienced was not hate.  It was the blind scythe of consistency.  It was -- in ye olde D&D parlance -- Lawful Evil.

But, the noise about this has reminded me of a bit of a conundrum I have over this whole rule.  What the hell is "code," anyway?  That may sound like a silly question for a programmer to be asking, but it is an important question.  Most technical definitions I can find suggest that it is some kind of symbolic set of instructions or rules intended to tell a computer what the heck to do.  In other words, the only thing that makes a recipe for chocolate chip cookies not code is that it is intended to be interpreted and executed by a human, rather than a computer.

We do use a considerable amount of data that contains instructions intended for computers, however.  Most document formats (aside from raw text) include some kind of markup that informs a viewer or editor application of the intended presentation logic for that document.  Isn't that code?  What about the formulas in a spreadsheet?  That's code, isn't it?  Isn't MIDI a set of instructions for playing music?

Where is the line, here?  If I make a game with monster AI that is driven by a state machine whose nodes and state changes are specified in an XML document, am I not running a program on a virtual machine?

Data influences how many non-trivial programs function.  A great deal of data is code.  Code is everywhere.

No comments: