This post originated from an RSS feed registered with .NET Buzz
by Mark Levison.
Original Post: Programs still edited as text redux
Feed Title: Mark Levison
Feed URL: /WebLog/error.aspx?aspxerrorpath=/WebLog/mlevison/Rss.aspx
Feed Description: Musings on No Touch Deployment, .NET development and photography
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:
IDE's need to better tools to manipluate their Abstract Syntax Trees
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).
This Blog Hosted On: http://www.DotNetJunkies.com/