I'm sure there are some people out there that are going to hate me for this, but I started thinking about the sorts of features that I want in the version of Visual Studio after VS2005 (codenamed Orcas). This idea came to me while I was talking to a student in the class I taught today as we walked down-stars.

Over the past twelve months or so I have become a huge fan of designer technology and I've started to imagine how good things could be not only on the component design surface but also inside the code-window - I was inspired in a big way by the improvements that have been made to the debugger, but I wanted something that could help me as I wrote the code - not as I watched it crash.

Anyway - my idea is "Builders" - I don't know if there is any prior art here, I don't care either, I want this feature. Basically, while typing in the code for my application I want VS to look-up metadata associated with the classes, properties, methods and method arguments that I am typing and render builders. As an example I have mocked up an XPath expression builder which is being applied to a string.

The method signature for the SelectSingleNode method would look something like the following.

public XmlNode SelectSingleNode(

    [Builder(typeof(XPathExpressionBuilder))] xpathExpression

    );

Because you'd want to be able to retro-fit the builders to existing code I would imagine some kind of XML drop point like we have for expansions to hook up builders to classes, properties, methods and method arguments. There would also be some overlap with existing property editors - perhaps "we" could find a way to host the editors inside a builder display when editors were specified, but builders weren't - the usual codedom generation could also come into play - but that would be secondary - and somewhat ugly.

The idea here is to reduce mistakes and also made the actual task of code development a little bit more guided. I chose XPath specifically because its a hard syntax to grasp sometimes - it also makes a good case for cross-language builders - the same builder could be mapped to functional programming langues - but also to declaritive data structures like XML.

Update: I made another post here about code builders - please read it before commenting re: embedding filenames in source code.