Mark Levison

Musings on No Touch Deployment, .NET development and photography

<May 2008>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567


Navigation

Other

Blogroll

Subscriptions

Post Categories



Programs still edited as text redux

Apparently I'm not the only who has been thinking about how we edit programs.  Jon Udell has written a column "Exploring the deep structure of code" and a blog entry "The deep structure of code". He mentions an interesting paper that I'd missed: "Example Centric Programming" (PDF) by Jonathon Edwards .  I think that Jonathon's "Manifesto of the Programmer Liberation Front" nicely summarizes much of what I was thinking about.  In particlular these paragraphs really resonate with me:
Text is a dead-end

Programming is stuck in an evolutionary dead-end: the use of character strings to encode programs. Every other computer-mediated form of expression has evolved beyond text into sophisticated WYSIWYG interfaces to complex data structures. For example, no one still uses textual markup for word processing (except, notably, Computer Scientists with TeX). We need WYSIWYG programming.

It's called 'code' for a reason

Programming languages are built upon two basic tricks: the use of grammars to encode tree structures (AST's) into text, and the use of names to encode linkages across these trees. Much of what makes a language unique is its particular style of name resolution, as in the polymorphism and inheritance techniques of OO languages. Text is a dead end because all these sophisticated techniques in one way or another are just encoding structure in text strings. This is disastrous for usability.

Structure needs to be made explicit and directly manipulable, not implicit and encoded. Mentally parsing and interpreting this implicit structure is an enormous cognitive burden for the programmer. Modern IDE's such as Eclipse go to great lengths to extract the encoded structure back out of the text and help us to visualize and manipulate it somewhat more directly. Refactorings are provided by the IDE to automate the complex and widespread changes in syntax necessary to effect simple semantic changes. This is absurd. We should manipulate semantic structures directly through a WYSIWYG interface. The language is the IDE.

Much of what we know about programming language design is about clever ways to encode structure in text, and fancy ontologies to rationalize naming. Discarding the textual representation suddenly makes all this irrelevant, and opens a whole new space of design choices. Some who are invested in the status quo will see this as a threat and become counter-revolutionaries.

When I wrote Programs still edited as text? Why?, I was struck by the absurity of tools like QuickCode .NET.  This is macro tool - I type in 'prop int test', do an Alt+Q and it generates a property for me. Pure text replacement.  It works well and is certainly faster than typing properties by hand, but simple text replacement strikes me as insane.  We could do this in emacs.  When inserting a new method why do we need to type all the kewords 'protected static void' - a better IDE would just prompt me for scope (public, protected, ...), modifiers (abstract, static, ...) and return type. I could continue this list for sometime to come - I think our modern IDEs are hampering our productivity.

What needs to be done? In the short term:

  1. IDE's need to better tools to manipluate their Abstract Syntax Trees
  2. The Abstract Syntax Trees need to be documented and made accessible to external vendors

BTW "QuickCode .Net" is perfectly good tool, I'm mention it only because I'm familiar with it.

Finally, Jon I hope that the tool vendors give you good reason to give up Emacs long before you retire (let alone go to the grave).

posted on Wednesday, January 19, 2005 12:59 PM by mlevison





Powered by Dot Net Junkies, by Telligent Systems