Another Use for Extensible Programming

September 19, 2008 – 12:51 pm

I’ve grumbled before about the fact that mass-market tools like Firefox and Microsoft Word allow people to mix pictures and text, but programmers’ editors (including IDEs) do not.  My standard answer when people ask why I’d want that is, “So that I can put before and after pictures of data structures for methods, just like I would in a textbook.”  Discussion about the Django port of DrProject has brought up another use case, though.  Suppose you need to initialize a set of objects for a test fixture, and their mutual reference graph contains cycles.  Using text, you have to do things like this:

left = Something(null)

right = Something(left)

left.setPartner(right)

It’s non-declarative, it’s error-prone, and worst of all, you have to relax the error-checking in classes so that they can be initialized in  states that you don’t want them to be in the real program.

Now, wouldn’t it be great if you could just draw what you want?  Imagine an editor that would let you create two circles (one for left, one for right) and join them up with arrows labeled “partner” to show the final state you wanted.  A combination of clever compilation and reflection could then stitch everything together for you.  What’s even nicer, you wouldn’t have to worry about how to bootstrap the fixture into a legal state.

Oh, but that’s crazy talk, isn’t it?  Non-ASCII content in programs?  Why, next you’ll be wanting pictures in debuggers, too…

  1. 2 Responses to “Another Use for Extensible Programming”

  2. Microsoft’s BizTalk is a very impressive development environment that uses graphical representations to define logic. It is designed for message exchange (primarily XML based data) so I wouldn’t imagine that it has any use for the web application space you are talking about, but I think it does a great job at letting you draw what you want.

    By Joel Hockey on Sep 21, 2008

  3. Ya, in some cases doing stuff visually is better than textually… Since BizTalk was mentioned, SAP XI is very similar in that you can visually specify how to map one structured document to another. And then you see the resulting XSLT file and wonder how long it would’ve taken you to create it manually…

    By Kosta Zabashta on Sep 26, 2008

Post a Comment