<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">RemLog</title><subtitle type="html" /><id>http://blogs.msdn.com/b/daveremy/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/daveremy/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2005-04-06T16:33:00Z</updated><entry><title>Non-Recursive Post Order Depth First Traversal in C#</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2010/03/16/non-recursive-post-order-depth-first-traversal.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2010/03/16/non-recursive-post-order-depth-first-traversal.aspx</id><published>2010-03-16T18:39:47Z</published><updated>2010-03-16T18:39:47Z</updated><content type="html">&lt;p&gt;I was looking around for a &lt;em&gt;non-recursive&lt;/em&gt; post-order traversal algorithm and it turned out to be more complex than I thought which surprised me.&amp;nbsp; I mean a &lt;em&gt;recursive&lt;/em&gt; post order depth first traversal is so simple.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; recursivePostOrder(Node node)
{
    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var n &lt;span class="kwrd"&gt;in&lt;/span&gt; node.Children)
    {
        recursivePostOrder(n);
    }
    &lt;span class="rem"&gt;// Do action&lt;/span&gt;
    Console.WriteLine(node.Id);
}&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;And a non-recursive &lt;strong&gt;Pre Order&lt;/strong&gt; Depth Traversal isn’t too difficult: 
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; preOrder(Node root)
{
    Stack&amp;lt;Node&amp;gt; s = &lt;span class="kwrd"&gt;new&lt;/span&gt; Stack&amp;lt;Node&amp;gt;();
    s.Push(root);
    &lt;span class="kwrd"&gt;while&lt;/span&gt; (s.Count &amp;gt; 0)
    {
        var n = s.Pop();
        &lt;span class="rem"&gt;// Do Action&lt;/span&gt;
        Console.Write(n.Id);
        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var child &lt;span class="kwrd"&gt;in&lt;/span&gt; n.Children.ToArray().Reverse())
        {
            s.Push(child);
        }
    }
}&lt;/pre&gt;
&lt;p&gt;After doing some searches and consulting some colleagues I couldn’t find a canonical non-recursive post order depth first algorithm (at least one that I could understand quickly).&amp;nbsp; Several of my colleagues also initially thought it was simple and then went back to their offices to later send me alternatives.&amp;nbsp; The essential challenge is to be able to know when the traversal has gone up a level and only at that point doing the “visit” action on the parent node.&amp;nbsp; Here is the most concise alternative I came up with that does not use a full visited list (the full program below): 
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; nonRecursivePostOrder(Node root)
{
    var toVisit = &lt;span class="kwrd"&gt;new&lt;/span&gt; Stack&amp;lt;Node&amp;gt;();
    var visitedAncestors = &lt;span class="kwrd"&gt;new&lt;/span&gt; Stack&amp;lt;Node&amp;gt;();
    toVisit.Push(root);
    &lt;span class="kwrd"&gt;while&lt;/span&gt; (toVisit.Count &amp;gt; 0)
    {
        var node = toVisit.Peek();
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (node.Children.Count &amp;gt; 0)
        {
            &lt;span class="rem"&gt;// PeekOrDefault is an extension helper, see full program below&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (visitedAncestors.PeekOrDefault() != node)
            {
                visitedAncestors.Push(node);
                toVisit.PushReverse(node.Children); &lt;span class="rem"&gt;// PushReverse is a helper, see full program below&lt;/span&gt;
                &lt;span class="kwrd"&gt;continue&lt;/span&gt;;
            }
            visitedAncestors.Pop();
        }
        Console.Write(node.Id);
        toVisit.Pop();
    }
}&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;The idea is here is to, in addition to the normal DFS toVisit stack, keep a visitedAncestors stack.&amp;nbsp; In the depth first traversal when we encounter a parent node (node.Children.Count &amp;gt; 0), if it hasn’t been visited yet (visitedAncestors.PeekOrDefault() != node), then add the children to the stack and don’t process the parent yet (leave the parent on the toVisit stack).&amp;nbsp; The next time the parent node is hit, the children will have already been processed then remove it from the visitedAncestors stack (visitedAncestors.Pop()) and drop down to process the parent node.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;There are multiple algorithms out there to accomplish this.&amp;nbsp; Several of my colleagues sent me their versions.&amp;nbsp; One version kept the state of child enumeration in the stack along with the node in the toVisit stack.&amp;nbsp; Another similarly used a structure in the toVisit stack that had a visited boolean along with the node.&amp;nbsp; This one also used an interesting linked list approach to the toVisit stack that allowed the children to not have to be reversed (if the childlist is forward only as it is in many trees then it has to be materialized in order to reverse it).&amp;nbsp; Still another colleague offered an algorithm in which the toVisit stack contains a boolean that keeps track of direction (down/child or next/sibling) and makes the action decision accordingly.&amp;nbsp; If there is interest I can likely publish these algorigthms as well.&amp;nbsp; What I am not sure of is whether there is a canonical “best” (complexity, space) algorithm for a non-recursive post order traversal.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Here is a full sample program with the helper methods and sample tree data structure:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; ConsoleApplication2
{

    &lt;span class="kwrd"&gt;class&lt;/span&gt; Program
    {
        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)
        {
            &lt;span class="rem"&gt;//       a&lt;/span&gt;
            &lt;span class="rem"&gt;//   b    c    d&lt;/span&gt;
            &lt;span class="rem"&gt;// e  f  g    h i&lt;/span&gt;
            &lt;span class="rem"&gt;// dfs: efbgchida&lt;/span&gt;
            var root = makeTree();
            nonRecursivePostOrder(root);
            Console.WriteLine();
        }

        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; nonRecursivePostOrder(Node root)
        {
            var toVisit = &lt;span class="kwrd"&gt;new&lt;/span&gt; Stack&amp;lt;Node&amp;gt;();
            var visitedAncestors = &lt;span class="kwrd"&gt;new&lt;/span&gt; Stack&amp;lt;Node&amp;gt;();
            toVisit.Push(root);
            &lt;span class="kwrd"&gt;while&lt;/span&gt; (toVisit.Count &amp;gt; 0)
            {
                var node = toVisit.Peek();
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (node.Children.Count &amp;gt; 0)
                {
                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (visitedAncestors.PeekOrDefault() != node)
                    {
                        visitedAncestors.Push(node);                        
                        toVisit.PushReverse(node.Children); 
                        &lt;span class="kwrd"&gt;continue&lt;/span&gt;;
                    }
                    visitedAncestors.Pop();
                }
                Console.Write(node.Id);
                toVisit.Pop();
            }
        }

        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Node makeTree()
        {
            var e = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"e"&lt;/span&gt;);
            var f = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"f"&lt;/span&gt;);
            var b = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"b"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Node&amp;gt; { e, f });
            var g = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"g"&lt;/span&gt;);
            var c = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"c"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Node&amp;gt; { g });
            var h = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"h"&lt;/span&gt;);
            var i = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"i"&lt;/span&gt;);
            var d = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"d"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Node&amp;gt; { h, i });
            var a = &lt;span class="kwrd"&gt;new&lt;/span&gt; Node(&lt;span class="str"&gt;"a"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Node&amp;gt; { b, c, d });
            &lt;span class="kwrd"&gt;return&lt;/span&gt; a;
        }
    }

    &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; StackHelper
    {

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Node PeekOrDefault(&lt;span class="kwrd"&gt;this&lt;/span&gt; Stack&amp;lt;Node&amp;gt; s)
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; s.Count == 0 ? &lt;span class="kwrd"&gt;null&lt;/span&gt; : s.Peek();
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PushReverse(&lt;span class="kwrd"&gt;this&lt;/span&gt; Stack&amp;lt;Node&amp;gt; s, List&amp;lt;Node&amp;gt; list)
        {
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var l &lt;span class="kwrd"&gt;in&lt;/span&gt; list.ToArray().Reverse())
            {
                s.Push(l);
            }
        }
    }

    &lt;span class="kwrd"&gt;class&lt;/span&gt; Node
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Id;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;Node&amp;gt; Children;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; Node(&lt;span class="kwrd"&gt;string&lt;/span&gt; id)
        {
            Id = id;
            Children = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Node&amp;gt;();
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; Node(&lt;span class="kwrd"&gt;string&lt;/span&gt; id, List&amp;lt;Node&amp;gt; children)
        {
            Id = id;
            Children = children;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Equals(&lt;span class="kwrd"&gt;object&lt;/span&gt; obj)
        {
            var node = obj &lt;span class="kwrd"&gt;as&lt;/span&gt; Node;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (node != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
            {
                &lt;span class="kwrd"&gt;return&lt;/span&gt; node.Id == &lt;span class="kwrd"&gt;this&lt;/span&gt;.Id;
            }
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; GetHashCode()
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Id.GetHashCode();
        }
    }
}


&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9979721" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Meeting Mike Vincent</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2008/09/16/meeting-mike-vincent.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2008/09/16/meeting-mike-vincent.aspx</id><published>2008-09-16T20:15:26Z</published><updated>2008-09-16T20:15:26Z</updated><content type="html">&lt;p&gt;(This a cross-post from remlog.net: &lt;a title="http://blog.remlog.net/?p=33" href="http://blog.remlog.net/?p=33"&gt;http://blog.remlog.net/?p=33&lt;/a&gt;) &lt;p&gt;Yesterday, I had the pleasure of meeting &lt;a href="http://mvasoftware.com/blogs/mikev_weblog/archive/2008/07/03/teched-recap.aspx"&gt;Mike Vincent&lt;/a&gt;, who is on the Board of Directors of &lt;a href="http://www.ineta.org/"&gt;INETA&lt;/a&gt; (International .NET Association) which works to coordinate a huge community of .NET user groups.&amp;nbsp;&amp;nbsp; INETA, is a non-profit almost entirely driven by volunteers who have an interest in sharing .NET knowledge and helping .NET user groups to be successful.  &lt;p&gt;Mike was in town for an INETA board meeting, the &lt;a href="http://msdn.microsoft.com/en-us/vsx/cc512752.aspx"&gt;Visual Studio Extensibility (VSX) Conference&lt;/a&gt; and to meet with various MS product teams to see how we could work together to improve the .NET User group experience.  &lt;p&gt;Mike was meeting with Harry Pierson (IronPython PM) and Bill Chiles (Dynamic Language Runtime Lead) to discuss INETA and dynamic languages so I was lucky enough to tag along and ask some questions.  &lt;p&gt;One question we asked was how important Mike saw Visual Studio Integration for the Iron languages.&amp;nbsp; We get feedback at times that it is more important to have a lightweight, quick to bring up, quick to close down, editor for script editing than full VS integration.&amp;nbsp; Others tell us, make sure that we integrate well with VS now since this is their primary code editing tool.&amp;nbsp; Mike's response was that VS integration is "a big deal" for adoption by the mainstream .NET developer and consequently a must have.&amp;nbsp;&amp;nbsp; &lt;p&gt;Mike mentioned a cool concept that INETA is embarking on around speakers.&amp;nbsp; INETA is known for its &lt;a href="http://www.ineta.org/Speakers/Speakers.aspx"&gt;speaker's bureau&lt;/a&gt; (and virtual user groups) which has been national&amp;nbsp; in scope.&amp;nbsp; They are now introducing regional speakers bureaus that will enable folks to speak regionally at smaller venues which can lead to the larger national opportunities.&amp;nbsp; Harry and I have talked about similar ideas for folks at Microsoft to start speaking at smaller venues that could lead to bigger opportunities such as Tech Ed and PDC.&amp;nbsp; Mike also mentioned that INETA is also heavily encouraging virtual presentations, recording live presentations, and having them available via the INETA website.&amp;nbsp; I wonder if there is some way Microsoft could leverage that as well, pointing customers to these presentations as they become available ... hmm, a todo for me.  &lt;p&gt;I asked Mike how he viewed dynamic languages in .NET.&amp;nbsp;&amp;nbsp; The value he sees is that advantage of providing&amp;nbsp; more tools for the .NET developer's toolbelt.&amp;nbsp; "Dynamic languages allow you to do some things much more easily than a static language".&amp;nbsp; The low ceremony aspects of IronPython and IronRuby in particular help.&amp;nbsp; &lt;p&gt;Mike has special interest in a project to allow NUnit tests to be written in IronPython.&amp;nbsp;&amp;nbsp; Using the low ceremony language like IronPython can make this feel very much like a &lt;a href="http://en.wikipedia.org/wiki/Domain_Specific_Language"&gt;DSL&lt;/a&gt; for testing.&amp;nbsp; We didn't get a chance to talk about it much but I look forward to learning more about it.&amp;nbsp; Harry has some ideas for how the IronPython team might be able to help.  &lt;p&gt;I asked Mike what the major issues with .NET and in his constituent user communities.&amp;nbsp;&amp;nbsp; The most significant one that came to mind for him was the problem with shops remaining on older releases (many in the user groups are still using .NET 1.1).&amp;nbsp;&amp;nbsp; Developers get frustrated since so many of the user groups and Microsoft talks are focused on new features (LINQ, et al) which are not yet available to them.&amp;nbsp;&amp;nbsp; He recognizes the tension between customers who feel there are too many releases and pressure from other customers (and the competitive landscape) to keep innovating.&amp;nbsp; Perhaps, we strategized, Microsoft should do more to innovate around helping customers move successfully from one .NET release to the next.  &lt;p&gt;It was great to meet Mike and hear about more about INETA.&amp;nbsp; It appears INETA has great momentum, with greater than 250 active user groups and over 100,000 active developers in North America, and a reach of approximately 1.2 million developers world-wide.&amp;nbsp;&amp;nbsp; I look forward to working with Mike and INETA to improve the .NET user group experience as well as .NET developers in general.  &lt;p&gt;Rem  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8954146" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Lunch with a Dynamics Languages Braintrust</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2008/09/15/lunch-with-a-dynamics-language-braintrust.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2008/09/15/lunch-with-a-dynamics-language-braintrust.aspx</id><published>2008-09-15T23:39:01Z</published><updated>2008-09-15T23:39:01Z</updated><content type="html">&lt;p&gt;One of the biggest privileges I have is the quality of people I get to hang out with here at Microsoft.&amp;nbsp; Within the Visual Studio Languages GO team and the &lt;a href="http://en.wikipedia.org/wiki/Dynamic_Language_Runtime"&gt;DLR&lt;/a&gt; team there is a loyal group of us (actually I am a noobie) who walk down from Redmond campus to the same Chinese place multiple times during the work week.&amp;nbsp; Each time there is a subset of us that make it but almost always there is enough for a quorum and we head on down. There is not a single one of these lunches that goes by that I don't get new insights, a few new facts, a good laugh, and a few blog ideas.&amp;nbsp; Not just technical stuff.&amp;nbsp; A big subject of today's lunch was &lt;a href="http://blogs.msdn.com/dinoviehland/archive/2008/03/17/ironpython-ms-sql-and-pep-249.aspx"&gt;Dino&lt;/a&gt;'s trip to &lt;a href="http://www.burningman.com/"&gt;Burning Man&lt;/a&gt; (wow, I want to go), but we also covered things like the economics of persistent data stores in the cloud, changes in the way Microsoft views Open Source, and &lt;a href="http://www.nbc.com/Saturday_Night_Live/video/clips/palin-hillary-open/656281/"&gt;Tina Fey's portrayal of Sarah Palin&lt;/a&gt;.&amp;nbsp; It reminds me that much of our most important activities and learning are NOT in meeting rooms but are at lunches and in hallways.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I took some pictures around the table at lunch today.&amp;nbsp; Ok, they don't look like a brain trust with their mouths full but believe me these guys are the sh*t.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0008_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="184" alt="PIC-0008" src="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0008_thumb.jpg" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/curth/default.aspx"&gt;Curt&lt;/a&gt; (IronCurt, Dev on IronPython and IronRuby), &lt;a href="http://www.iunknown.com/"&gt;John&lt;/a&gt; (IronRuby PM), and &lt;a href="http://tmd.havit.cz/"&gt;Tomas&lt;/a&gt; (Lead Dev on IronRuby).&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0009_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="184" alt="PIC-0009" src="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0009_thumb.jpg" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.jredville.com/"&gt;Jim&lt;/a&gt; (Tester IronRuby), &lt;a href="http://blogs.msdn.com/dinoviehland/archive/2008/03/17/ironpython-ms-sql-and-pep-249.aspx"&gt;Dino&lt;/a&gt; (Lead Dev on IronPython), and &lt;a href="http://www.devhawk.net/"&gt;Harry&lt;/a&gt; (PM for IronPython)&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0010_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="184" alt="PIC-0010" src="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0010_thumb.jpg" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.jimmy.schementi.com/"&gt;Jimmy&lt;/a&gt; (PM on all sorts of IronRuby and IronPython stuff), &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc300886.aspx"&gt;Bill&lt;/a&gt; (PM for DLR), and me.&lt;/p&gt; &lt;p&gt;I can think of many times in my career when I would not attend these types of lunches.&amp;nbsp; Too much work to do.&amp;nbsp; Funny thing, I think I got more accomplished at lunch today than two of my scheduled meetings.&lt;/p&gt; &lt;p&gt;rem&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8953065" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Sapir-Whorf Revisited</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2008/08/07/sapir-whorf-revisited.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2008/08/07/sapir-whorf-revisited.aspx</id><published>2008-08-07T21:37:54Z</published><updated>2008-08-07T21:37:54Z</updated><content type="html">&lt;p&gt;This is a cross post from my blog (&lt;a href="http://blog.remlog.net"&gt;http://blog.remlog.net&lt;/a&gt;) here: &lt;a title="http://blog.remlog.net/?p=5" href="http://blog.remlog.net/?p=5"&gt;http://blog.remlog.net/?p=5&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A friend from Microsoft reminded me of a post I did on my MSDN blog when I was previously at Microsoft on the &lt;a href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis"&gt;Sapir-Whorf hypothesis&lt;/a&gt; (roughly, the hypothesis that your language shapes your view of reality) and its application to programming languages.&amp;nbsp; The blog was: &lt;a href="http://blogs.msdn.com/daveremy/archive/2005/04/06/sapirwhorfs.aspx"&gt;The Sapir-Whorf hypothesis. Does program language “centricity” limit you?&lt;/a&gt;&amp;nbsp; At that time (April 2005) I was just making the transition from Java to C#, learning some ML in the CS master's program at Depaul, and, getting influenced by a few quite a bit by a few Ph.D. friends down the hall at Microsoft (in particular &lt;a href="http://research.microsoft.com/~emeijer/"&gt;Erik Meier&lt;/a&gt; and &lt;a href="http://www.uni-koblenz.de/~laemmel/Site/Home.html"&gt;Ralf Lammel&lt;/a&gt;).&amp;nbsp;&amp;nbsp; I had nearly forgotten the post but looking back on it I guess I was fated to end up in a group focused on implementing programming languages such as Ruby and Python (and perhaps other emerging languages over time).&lt;/p&gt; &lt;p&gt;By the way, it appears that Sapir-Whorf has more acceptance in programming languages and methodologies than it does in psycho-linguists circles (&lt;a href="http://talklikeaduck.denhaven2.com/articles/2007/06/11/sapir-whorf"&gt;here&lt;/a&gt;, and &lt;a href="http://www.aber.ac.uk/media/Students/njp0001.html"&gt;here&lt;/a&gt;) at least at the extreme end of the&amp;nbsp; language determinism spectrum.&lt;/p&gt; &lt;p&gt;On another note Sapir-Whorf is being invoked regularly in relation to &lt;a href="http://en.wikipedia.org/wiki/Behavior_driven_development"&gt;Behavior Driven Development&lt;/a&gt; (BDD) as implemented in &lt;a href="http://rspec.info/"&gt;RSpec&lt;/a&gt; the popular ruby testing framework.&amp;nbsp; BDD is heralded as an evolution of Test Driven Development (TDD to get to the promised land of TDD where tests become executable specifications.&amp;nbsp;&amp;nbsp;&amp;nbsp; Developers move from using the verbiage of "test" and "assert" to words like "describe" and "should" using the business domain language as much as possible.&amp;nbsp; There are many &lt;a href="http://www.agilejournal.com/content/view/597/76/"&gt;articles&lt;/a&gt; and &lt;a href="http://www.lukeredpath.co.uk/2006/8/29/developing-a-rails-model-using-bdd-and-rspec-part-1"&gt;blogs&lt;/a&gt;&amp;nbsp; (just web search 'rspec sapir-worf') linking RSpec to the Sapir-Whorf hypothesis (many of them pretty in a pretty cavalier manner) .&amp;nbsp; The general idea appears to be that because BDD changes the words for writing&amp;nbsp; "tests" (whoops, I used the wrong word there), I mean "specifications", which in turn influences the developer's to think differently about tests.&amp;nbsp;&amp;nbsp; I generally agree with the conclusion, we are using a variation of RSpec to test &lt;a href="http://www.ironruby.net/"&gt;IronRuby&lt;/a&gt; completion and we think of it very much like a language specification,&amp;nbsp; however I am not so sure that Sapir-Whorf is the right theory to support this change in perception.&amp;nbsp; I am no expert whatsoever but it seems that the language determinism point of Sapir-Whorf is about an entire language shaping an individual's view of reality based on the inventory of words available to express a concept.&amp;nbsp; It seems like BDD's effectiveness is orthogonal to Sapir-Whorf since the developer is already likely to know and understand the concept of "test" and "assert".&amp;nbsp; RSpec is really influencing a &lt;a href="http://en.wikipedia.org/wiki/Mindset"&gt;mindset&lt;/a&gt; by introducing and enforcing words that will invoke a "set of assumptions, methods, or notations" that create a "powerful incentive" to "adopt or accept" a set of "behaviours, choices, or tools" (paraphrase of the &lt;a href="http://en.wikipedia.org/wiki/Mindset"&gt;wikipedia entry for mindset&lt;/a&gt;).&amp;nbsp;&amp;nbsp; I like the response that John Roth gave &lt;a href="http://tech.groups.yahoo.com/group/extremeprogramming/message/113260"&gt;here&lt;/a&gt; along these lines.&amp;nbsp; This is all just quibbling though.&amp;nbsp; RSpec is a most excellent step forward.&lt;/p&gt; &lt;p&gt;rem&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8841456" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Back To Microsoft</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2008/08/07/back-to-microsoft.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2008/08/07/back-to-microsoft.aspx</id><published>2008-08-07T21:28:00Z</published><updated>2008-08-07T21:28:00Z</updated><content type="html">&lt;P&gt;I am back at Microsoft!&amp;nbsp; In October of 2007 I left my developer role on the XML Team and headed out to a local Redmond consulting firm and then to an Internet startup &lt;A class="" title=uboost href="http://www.uboost.com/" mce_href="http://www.uboost.com"&gt;uboost&lt;/A&gt;&amp;nbsp;based in Honolulu.&amp;nbsp; I recently came back to be Lead Program Manager on the Visual Studio Languages Growth Opportunity (GO) team.&amp;nbsp; If you are interested I wrote a blog on my experience on my blog at &lt;A href="http://blog.remlog.net/"&gt;http://blog.remlog.net&lt;/A&gt; &lt;A class="" title="Back To Microsoft" href="http://blog.remlog.net/?p=4" mce_href="http://blog.remlog.net/?p=4"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I am having a great time getting getting geeked out on languages and working with a tremendous team.&amp;nbsp; More blogs on my personal blog and crossposted here where it makes sense.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Dave&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8841453" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Changing status, moving forward</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2006/06/16/david.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2006/06/16/david.aspx</id><published>2006-06-16T20:36:00Z</published><updated>2006-06-16T20:36:00Z</updated><content type="html">&lt;P&gt;A&amp;nbsp;quick note about what I am up to these days.&amp;nbsp; Lots of folks have been asking me if I am going to ever blog again -&amp;nbsp;for good reason considering the timing of my blogs so far, but, yes, I plan to get started again.&amp;nbsp; My friend and guy in the office next door at Microsoft, Ralf Lammel, has started his new blog (&lt;A href="http://blogs.msdn.com/ralflammel/"&gt;http://blogs.msdn.com/ralflammel/&lt;/A&gt;) so perhaps that will inspire me.&amp;nbsp; I love to read Ralf's papers and email (and I am sure blogs) since he&amp;nbsp;writes in his own&amp;nbsp; interesting, quirky style.&amp;nbsp; Ralf came over from Germany and speaks German natively but I'm not sure that completely explains his style :)&amp;nbsp; I think it is more that he has a sense of play and humor even about complex computer science subjects and it shows through in his writing.&amp;nbsp; I have had the luxury to publish several papers with him and I always get a good laugh and a lot of enjoyment working with him.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;My role at Microsof has changed a bit in the last few months.&amp;nbsp; For awhile there I was&amp;nbsp;the program manager for XLinq (XML Language Integrated Query) technology which is the XML specific implementation for LINQ (&lt;A href="http://msdn.microsoft.com/data/ref/linq/"&gt;http://msdn.microsoft.com/data/ref/linq/&lt;/A&gt;) then, for a briefly (a few months) I took on the Group Program Manager role for the XML team.&amp;nbsp; This put me into a middle management role that I really did not like, so, when we (Microsoft) decided to consolidate our XML team into a larger data programmability team I jumped at the opportunity to move back over into a development role.&amp;nbsp; I am now working hands on a very cool XML developer tool (can't say specifically what quite yet) that uses WPF (also known as Avalon) and XLinq extensively.&amp;nbsp; I look forward to doing some future blogs in these areas.&amp;nbsp; So far I&amp;nbsp;reeeaaally enjoy working with these technologies.&amp;nbsp; I have already&amp;nbsp;had&amp;nbsp;the chance to work with XLinq quite a&amp;nbsp;bit and&amp;nbsp;so I knew what a pleasure it is to write XML code&amp;nbsp;in that technology (who would of thought - a "pleasure" to write XML code?).&amp;nbsp; WPF is quite a bit&amp;nbsp;different&amp;nbsp;but I am super impressed.&amp;nbsp; From my perspective it has a consistency of architecture and composability that makes it super powerful yet very approachable.&amp;nbsp; The big challenge with WPF is there are not yet mature tools for it and the community around it is just forming.&amp;nbsp; So when you run into an issue it is often not as simple as just doing a web search to find the answer.&amp;nbsp; Also there is not a huge amount of documentation out there yet (although &lt;A href="http://www.amazon.com/gp/product/0596101139/103-3546045-9172639?v=glance&amp;amp;n=283155 "&gt;Chris Sells book&lt;/A&gt; is really good).&amp;nbsp; If the app that I am working on is any indication the next generation of "fat client" apps written with WPF will be amazing.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The other big thing that is going on with me is that I am doing &lt;A href="http://www.ironmancda.com/"&gt;Ironman Coeur D'Alene &lt;/A&gt;on June 25.&amp;nbsp; Which is about 8 days from now.&amp;nbsp; I have done the "iron training" and should feel confident but I have to admit I am freaking out a bit.&amp;nbsp; If you want to follow my progress (for some strange reason) it should be available on &lt;A href="http://ironman.com/ironmanlive/racedaycoverage/livetrackinginfo"&gt;Ironman Live &lt;/A&gt;&amp;nbsp;(my number is: 1455).&amp;nbsp; I will definitely be slow.&amp;nbsp; I am guessing 14 hours or so but I really have no idea.&amp;nbsp; I just hope to finish ...&lt;/P&gt;
&lt;P&gt;A week later my wife and I&amp;nbsp;are heading over to Tuscany, Italy for a two week bike trip from Fiorenza (a.k.a., Florence) to Rome.&amp;nbsp; I hope I can ride by then!&lt;/P&gt;
&lt;P&gt;Anyway, more blogs soon although&amp;nbsp; I suspect I will have a hard time keeping up with Ralf.&lt;/P&gt;
&lt;P&gt;thanks! rem&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=634391" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>XNames and Expanded Names</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2005/09/22/473126.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2005/09/22/473126.aspx</id><published>2005-09-23T05:51:00Z</published><updated>2005-09-23T05:51:00Z</updated><content type="html">&lt;P&gt;At&amp;nbsp; my &lt;A href="http://216.55.183.63/pdc2005/slides/DAT324_Remy.ppt"&gt;XLinq PDC2005 talk &lt;/A&gt;and in the &lt;A href="http://msdn.microsoft.com/VBasic/Future/XLinq%20Overview.doc"&gt;&lt;STRONG&gt;XLinq Overview Document&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;one of the differences I mentioned between XLinq and DOM is the treatment of XML Names in XLinq.&amp;nbsp; XLinq's abstraction for XML Names is a class called &lt;STRONG&gt;XName&lt;/STRONG&gt; which is the only way an XML Name shows up anywhere in the API.&amp;nbsp; You seldom have to construct an XName since there is an implicit conversion from string.&amp;nbsp; For example to construct an XElement with a local name Foo that has a namespace of &lt;A href="http://mycompany.com/"&gt;http://myCompany.com&lt;/A&gt; you could do the following:&lt;/P&gt;
&lt;P&gt;XElement foo = new XElement("&lt;STRONG&gt;{http://myCompany.com}Foo&lt;/STRONG&gt;",&amp;nbsp; ... any value or children of Foo ...);&lt;/P&gt;
&lt;P&gt;So what is that string there with the curly braces in the constructor you ask?&amp;nbsp; XLinq calls it&amp;nbsp;the &lt;EM&gt;Expanded Name&lt;/EM&gt;.&amp;nbsp; This idea is very much inspired by James Clark's paper on &lt;A href="http://www.jclark.com/xml/xmlns.htm"&gt;XML Namespaces &lt;/A&gt;in which he talks about &lt;EM&gt;Universal Names&lt;/EM&gt;&amp;nbsp;defined as a local name and a qualifying URI.&amp;nbsp; In his article he shows that XML Names are fundamentally these Universal Names (or what XLinq calls Expanded Names) and prefixes/default namespaces are simply shorthand for representing this full name (in a way that would work with XML 1.0 since XML was initially defined without XML Namespaces).&amp;nbsp;&amp;nbsp; He&amp;nbsp;gives example in his paper of how default namespaces and prefixes map into&amp;nbsp;Universal Names.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This is essentially what XLinq does in&amp;nbsp;its API.&amp;nbsp;&amp;nbsp;When the XML is loaded into memory the default namespaces and prefixes are resolved to their corresponding Expanded Names and that is they way you deal with them in the API, via XNames.&amp;nbsp;&amp;nbsp; Namespace declarations (xmlns attributes) are retained as attributes in the in-memory tree and on output are&amp;nbsp;used to associate prefixes with namespaces all over again.&amp;nbsp; In other words from XLinq's perspective default namespace declarations and prefix declarations are purely serialization options.&amp;nbsp; If you want to associate a prefix with a namespace in your output, say when creating a document from scratch, then you add an xmlns attribute right where you want the prefix defined.&amp;nbsp; There are helper methods in XLinq&amp;nbsp; planned (CreateNamespacePrefix, CreateDefaultNamespaceDecl - or something) but I put some notes at the end of the XLinq overview doc on how to do that manually if needed.&amp;nbsp; The only trick is knowing the namespace of the xmlns attribute (&lt;A href="http://www.w3.org/2000/xmlns"&gt;http://www.w3.org/2000/xmlns&lt;/A&gt;).&amp;nbsp; For example to declare the prefix ns and associate it with &lt;A href="http://myCompany.com"&gt;http://myCompany.com&lt;/A&gt; you could add the following attribute where you want it defined.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;new&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; &lt;SPAN style="COLOR: teal"&gt;XAttribute&lt;/SPAN&gt;(&lt;SPAN style="COLOR: maroon"&gt;"{http://www.w3.org/2000/xmlns/}ns"&lt;/SPAN&gt;,&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;&lt;A href="http://myCompany.com"&gt;http://myCompany.com&lt;/A&gt;&lt;/SPAN&gt;),&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT size=3&gt;Anyway, I think James Clarks article on XML Namespaces is one of the better explanations on the subject&amp;nbsp;and&amp;nbsp;understanding&amp;nbsp;that XML Names are really&amp;nbsp;namespace+local name simplifies&amp;nbsp;working with names in&amp;nbsp;XLinq.&amp;nbsp; I find that the XML code that I write, which pretty much always has namespaces involved, is quite a bit clearer and cleaner than the equivalent DOM code.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT size=3&gt;This is an area we are looking for feedback.&amp;nbsp; Lemme know what you think.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT size=3&gt;cya,&lt;BR&gt;rem&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=473126" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Anders unveils LINQ! (and XLinq)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2005/09/13/465006.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2005/09/13/465006.aspx</id><published>2005-09-13T22:29:00Z</published><updated>2005-09-13T22:29:00Z</updated><content type="html">&lt;P&gt;In Jim Allchin's keynote At PDC2005 today Anders Hejlsberg showed the LINQ project for the first time.&amp;nbsp; LINQ stands for Language Integrated Query.&amp;nbsp; The big idea behind LINQ is to provide a consistent query experience across different "LINQ enabled" data access technologies AND to allow querying these different data access technologies in a single query.&amp;nbsp; Out of the box there are three LINQ enabled data access technologies that are being shown at PDC.&amp;nbsp; The first is any in-memory .NET collection that you foreach over (any .NET collection that implements IEnumerable&amp;lt;T&amp;gt;).&amp;nbsp; The second is DLinq which provides LINQ over a strongly typed relational database layer.&amp;nbsp; The third, which I have been working on for the last 6 months or so (along with Anders and others on the WebData XML team), is XLinq, a new in-memory XML programming API that is Language Integerated Query enabled.&amp;nbsp; It is great to get the chance to get this technology to the next stage of development and get&amp;nbsp;all of you&amp;nbsp;involved.&amp;nbsp; The LINQ Preview bits (incuding XLinq and DLinq) are being made available to PDC attendees.&amp;nbsp; More information on the LINQ project (including &amp;nbsp;the preview bits) are also available online at &lt;A href="http://msdn.microsoft.com/netframework/future/linq"&gt;http://msdn.microsoft.com/netframework/future/linq&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;More specifically about XLinq, XLinq is a new in-memory XML programming API that is LINQ enabled.&amp;nbsp; Essentially it is a redesigned XML DOM API that was built from the ground up with lessons from the last 10 years of DOM as well as with Language Integrated Query in mind.&amp;nbsp; There are some significant innovations from DOM that are outlined in the XLinq overview document but one very important aspect was taking advantage of modern language features such as generics, nullable types, and especially IEnumerable&amp;lt;T&amp;gt;.&amp;nbsp; XLinq takes advantage of the 30 some odd Standard Query Operators (like where, select, orderby, groupby, etc.) from LINQ and then layers in a set of XML specific query operators that help when you are querying an XML tree -&amp;nbsp;operators like Descendants, Ancestors, Parent, etc.&amp;nbsp; With the standard query operators combined with the XML specific query operators you get fully featured XML Query functionality that is Language Integrated (assuming the the language implements the LINQ pattern, which C#, VB, and C++ are planned).&amp;nbsp;&amp;nbsp; In the samples that install with the LINQ bits there are hundreds of queries that you can check out including many from the XQuery Use Cases.&amp;nbsp; There is&amp;nbsp;an Xlinq overview doc that is posted on the LINQ Project site.&amp;nbsp; Here is a direct link: &lt;A href="http://download.microsoft.com/download/c/f/b/cfbbc093-f3b3-4fdb-a170-604db2e29e99/XLinq%20Overview.doc"&gt;http://download.microsoft.com/download/c/f/b/cfbbc093-f3b3-4fdb-a170-604db2e29e99/XLinq%20Overview.doc&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Anders has a detailed presentation tomorrow on LINQ and I am presenting more on XLinq on Friday.&amp;nbsp; I'll post more details over the days and weeks ahead.&amp;nbsp; I look forward to your feedback!&lt;/P&gt;
&lt;P&gt;rem&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=465006" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author><category term="XML and .NET Futures" scheme="http://blogs.msdn.com/b/daveremy/archive/tags/XML+and+-NET+Futures/" /><category term="PDC2005" scheme="http://blogs.msdn.com/b/daveremy/archive/tags/PDC2005/" /></entry><entry><title>PDC prez: The .NET Language Integrated Query Framework with XML Data</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2005/09/01/459381.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2005/09/01/459381.aspx</id><published>2005-09-02T00:02:00Z</published><updated>2005-09-02T00:02:00Z</updated><content type="html">&lt;P&gt;I will be doing a presentation at PDC this year on&amp;nbsp;Using the .NET Language Integrated Query Framework with XML Data.&amp;nbsp; The presentation is on Friday (8/16) at 10:30.&amp;nbsp; Hope to see you there!&lt;/P&gt;
&lt;P&gt;Here is the abstract:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#000000&gt;One of the key challenges to working with XML data has been the impedance mismatch between XML and programming languages. This session introduces future advances Microsoft is making for the "Orcas" release of Visual Studio in programming languages and frameworks to help integrate XML and queries with C# and Visual Basic. The advances include a framework for navigating, querying, and transforming XML that is both easier to use and more efficient than current XML programming techniques. This framework marries the capabilities of XPath, XQuery, and the DOM with the language integrated query framework planned for C# and Visual Basic. It is suggested that you attend "The .NET Language Integrated Query Framework: An Overview" before attending this session.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Luca is doing a talk on Using the .NET Language Integrated Framework with Relational Data and blogs about it here:&amp;nbsp; &lt;a href="http://blogs.msdn.com/lucabol/archive/2005/07/14/438824.aspx"&gt;http://blogs.msdn.com/lucabol/archive/2005/07/14/438824.aspx&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=459381" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author><category term="PDC2005" scheme="http://blogs.msdn.com/b/daveremy/archive/tags/PDC2005/" /></entry><entry><title>The Sapir-Whorf hypothesis.  Does program language “centricity” limit you?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/daveremy/archive/2005/04/06/sapirwhorfs.aspx" /><id>http://blogs.msdn.com/b/daveremy/archive/2005/04/06/sapirwhorfs.aspx</id><published>2005-04-07T01:33:00Z</published><updated>2005-04-07T01:33:00Z</updated><content type="html">&lt;DIV class=Section1&gt;
&lt;P class=MsoNormal&gt;I recently came over from the Java world to work at Microsoft as a program manager on the &lt;a href="http://blogs.msdn.com/xmlteam/"&gt;XML team at Microsoft&lt;/A&gt;.&amp;nbsp; From my experience with BEA (and prior) I was a “java centric” developer.&amp;nbsp;&amp;nbsp; I had academic exposure to C++ and some practical exposure to VB, ASP, and a few other languages, but my focus was Java.&amp;nbsp;&amp;nbsp; For me that meant, when I thought in code, I thought in Java.&amp;nbsp; When I looked at code in another language I would interpret it into Java.&amp;nbsp; “Ah, this is the same as a package in Java, or, I’ve never seen anything like that in Java!&amp;nbsp; Crazy …”.&amp;nbsp;&amp;nbsp; With this view of the world, the strategy I took to grow myself as a better developer was to read and learn more and more stuff about the details of Java.&amp;nbsp; Frankly, I figured if it wasn’t covered by Java it probably wasn’t that important to learn.&lt;/P&gt;
&lt;P class=MsoNormal&gt;A confluence of events recently has me thinking about this “language centric” approach to personal growth as a software developer.&amp;nbsp;&amp;nbsp; It started initially by the need to move over to C# as the logical transition for me from Java as my primary working language.&amp;nbsp; Like many in the Java world, I looked at C# as a Java knock off that would be simple to pick up.&amp;nbsp; What I found however, to my surprise, was that there are subtle but significant differences that affected the way I “think” about writing code.&amp;nbsp; Little things like not forcing the file name to correspond with the class (and allowing multiple classes per file and for multiple “packages/namespaces” to be defined in a single file), operator overloading, explicitly defining “virtual” methods, implicit boxing, … (&lt;A href="http://www.25hoursaday.com/CsharpVsJava.html#namespace"&gt;See Dare Obsanjo’s article on the comparison between Java and C#&lt;/A&gt;) accumulate such that I began to realize that C# is not just Java warmed over but represents a similar but different “&lt;A href="http://en.wikipedia.org/wiki/World_view"&gt;world view&lt;/A&gt;” of software development.&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoNormal&gt;Working at Microsoft I have the incredible opportunity to work with people such as &lt;A href="http://research.microsoft.com/~emeijer/"&gt;Erik Meijer&lt;/A&gt; (C Omega, Haskell DB, much more), &lt;A href="http://en.wikipedia.org/wiki/Anders_Hejlsberg"&gt;Anders Hejlsberg&lt;/A&gt; (C#, .NET, Delphi, Turbo Pascal, much more), and &lt;A href="http://homepages.cwi.nl/~ralf/"&gt;Ralf Lammel&lt;/A&gt; who challenge me to think outside the Java/imperative programming box. &amp;nbsp;&amp;nbsp;All three of these guys take an expansive view on programming language concepts and are constantly incorporating the lessons learned from a variety of language families and dialects into their own thinking – and consequently into the technologies they are creating.&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoNormal&gt;A professor of mine at DePaul, &lt;A href="http://facweb.cs.depaul.edu/jrogers/"&gt;Dr. John Rodgers&lt;/A&gt;, introduced the &lt;A href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesishttp:/en.wikipedia.org/wiki/Sapir-Whorf_hypothesis"&gt;Sapir-Whorf hypothesis&lt;/A&gt; to me recently.&amp;nbsp; This hypothesis says that there is a relationship between the language a person speaks and how that person understands the world and behaves in it [1].&amp;nbsp;&amp;nbsp; The linguistic hypothesis applies directly to programming languages.&amp;nbsp; The idea is “when designing an algorithm to solve a particular algorithm, programmers are heavily influenced by the language constructs available.”[2]&amp;nbsp; A part of this could be just the &lt;I&gt;friction&lt;/I&gt; necessary to implement certain programming concepts in different languages however there is more to it.&amp;nbsp;&amp;nbsp; I remember in my early days of developing I worked at a bank with a brilliant developer named Mike Hackett who had read the original Smalltalk 80 book and decided that we could build an object oriented Customer Relationship Management System using COBOL and DB2.&amp;nbsp; Needless to say there was a LOT of friction to build that system.&amp;nbsp;&amp;nbsp; I don’t think it is unreasonable to say COBOL developers did not naturally think in object oriented ways because COBOL did not have the expressiveness to lead developers to think that way.&amp;nbsp; This is similar to the issue pointed out by Benjamin Whorf of Eskimos thinking about camels or the Sahara desert.&amp;nbsp; They may have &lt;A href="http://rec-puzzles.org/new/sol.pl/trivia/eskimo.snow"&gt;20 words for snow&lt;/A&gt; which allow more elaborate patterns of communication about snow related strategies (algorithms) but be very primitive in other areas such as things that have to do with heat or animals in another ecosystem. &amp;nbsp;&amp;nbsp;COBOL has a rich data section and is expressive in the area of records (snow) but did not have language constructs to facilitate object orientation (camels).&amp;nbsp; (Ralf pointed out to me that COBOL has had an object oriented version since 1994, but, ahem, this was before that ...).&lt;/P&gt;
&lt;P class=MsoNormal&gt;I am realizing, at least for me, that working with C#, VB.Net, research languages like &lt;A href="http://www.eweek.com/article2/0,1759,1683952,00.asp"&gt;SpecSharp&lt;/A&gt; and &lt;A href="http://research.microsoft.com/Comega/"&gt;C Omega&lt;/A&gt;, functional languages such as &lt;A href="http://www.dcs.napier.ac.uk/course-notes/sml/manual.html"&gt;ML&lt;/A&gt; and &lt;A href="http://www.haskell.org/"&gt;Haskell&lt;/A&gt; (yes, I know Erik and Ralf, Haskell is waaaay superior to ML ;)), and dynamic languages such as &lt;A href="file:///p:/www.cpan.org/"&gt;Perl&lt;/A&gt; and &lt;A href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/A&gt; contain critical lessons for my growth as a software developer.&amp;nbsp; The applicability of the Sapir-Whorf hypothesis for me is that these languages give orthogonal views on solving programming problems and thus provide mental options, a more flexible algorithmic toolbox, even if continuing to work in the same language.&amp;nbsp; For example, my friend Mike Hackett was inspired by SmallTalk but the language we had available was COBOL/DB2 and we were able to architect an extremely successful system because of that inspiration.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Given that I work for Microsoft you might interpret that I am arguing the benefits of Microsoft’s multi-language .NET CLR approach which supports multiple languages over a common virtual machine.&amp;nbsp; I am not making that argument, although it might be true, and I do believe that multi-language support is a good thing.&amp;nbsp; However, the CLR itself embodies a paradigm that influences and constrains the languages that are built on top of it.&amp;nbsp; The risks of language centricity apply to .NET centricity as well (although at a higher level of abstraction).&amp;nbsp; A positive byproduct that I see from the CLR’s multi-language support is pressure on the CLR to expand its constraints, to challenge its preconceptions of the world as new languages get ported to the CLR platform (for an example see &lt;A href="http://www.ironpython.com/"&gt;IronPython&lt;/A&gt;).&amp;nbsp; Also, I see these concepts being weighed in the language design of .NET languages like C# and VB.NET.&amp;nbsp; For example C# 2.0 has been influenced by functional programming languages and I anticipate C# 3.0 will be as well.&amp;nbsp; Over time I believe it is likely the multi-language aspect of .NET will give it an advantage over Java as multiple programming model/language “world views” influence the CLR&amp;nbsp; (many languages are ported are being ported to CLR), and consequently influence the different CLR languages that have these new &lt;I&gt;inspired &lt;/I&gt;underlying features available.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoNormal&gt;My personal take away out of this is that language centricity was not the only or best strategy for growing as a software developer.&amp;nbsp; Exploring and understanding other programming languages particularly from the non-imperative programming paradigms provide new opportunities is highly leveraged, new insights give you new ways to address computational problems.&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoNormal&gt;Are you limiting yourself by focusing exclusively on one language?&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;Other reading:&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;[1] Sapir-Whorf hypothesis, &lt;A href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis"&gt;http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;[1.1] On the Sapir-Whorf hypothesis and its relation to programming languages, &lt;A href="http://www.cerezo.name/archives/000005.html"&gt;http://www.cerezo.name/archives/000005.html&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;[2] Sapir-Whorf and programming languages, David Cerezo’s Weblog, &amp;nbsp;&lt;A href="http://en.wikipedia.org/wiki/Sapir-Whorf_and_programming_languages"&gt;http://en.wikipedia.org/wiki/Sapir-Whorf_and_programming_languages&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;[3] Edward Sapir, &lt;A href="http://www.yale.edu/linguist/Sapir.html"&gt;http://www.yale.edu/linguist/Sapir.html&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;[4] Benjamin Whorf, &lt;A href="http://mtsu32.mtsu.edu:11072/Whorf/mindblw.htm"&gt;http://mtsu32.mtsu.edu:11072/Whorf/mindblw.htm&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;[5] The Language List, &lt;A href="http://people.ku.edu/~nkinners/LangList/Extras/langlist.htm"&gt;http://people.ku.edu/~nkinners/LangList/Extras/langlist.htm&lt;/A&gt; Collected information on about 2500 Computer Languages, Past and Present&lt;/P&gt;
&lt;P class=MsoNormal&gt;[6] History of Programming Languages, O’Reilly Poster, &lt;A href="http://www.oreilly.com/news/graphics/prog_lang_poster.pdf"&gt;http://www.oreilly.com/news/graphics/prog_lang_poster.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;[7] Computer Languages History: &lt;A href="http://www.levenez.com/lang/"&gt;http://www.levenez.com/lang/&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=405987" width="1" height="1"&gt;</content><author><name>daveremy</name><uri>http://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx</uri></author></entry></feed>