RemLoghttp://blogs.msdn.com/b/daveremy/atom.aspxTelligent Evolution Platform Developer Build (Build: 5.6.50428.7875)2004-12-21T11:26:00ZNon-Recursive Post Order Depth First Traversal in C#http://blogs.msdn.com/b/daveremy/archive/2010/03/16/non-recursive-post-order-depth-first-traversal.aspx2010-03-16T18:39:47Z2010-03-16T18:39:47Z<p>I was looking around for a <em>non-recursive</em> post-order traversal algorithm and it turned out to be more complex than I thought which surprised me.&nbsp; I mean a <em>recursive</em> post order depth first traversal is so simple.</p><pre class="csharpcode"><span class="kwrd">static</span> <span class="kwrd">void</span> recursivePostOrder(Node node)
{
<span class="kwrd">foreach</span> (var n <span class="kwrd">in</span> node.Children)
{
recursivePostOrder(n);
}
<span class="rem">// Do action</span>
Console.WriteLine(node.Id);
}</pre>
<style type="text/css">.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; }
</style>
<p>And a non-recursive <strong>Pre Order</strong> Depth Traversal isn’t too difficult:
<style type="text/css">.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; }
</style>
</p><pre class="csharpcode"><span class="kwrd">static</span> <span class="kwrd">void</span> preOrder(Node root)
{
Stack&lt;Node&gt; s = <span class="kwrd">new</span> Stack&lt;Node&gt;();
s.Push(root);
<span class="kwrd">while</span> (s.Count &gt; 0)
{
var n = s.Pop();
<span class="rem">// Do Action</span>
Console.Write(n.Id);
<span class="kwrd">foreach</span> (var child <span class="kwrd">in</span> n.Children.ToArray().Reverse())
{
s.Push(child);
}
}
}</pre>
<p>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).&nbsp; Several of my colleagues also initially thought it was simple and then went back to their offices to later send me alternatives.&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.&nbsp; Here is the most concise alternative I came up with that does not use a full visited list (the full program below):
<style type="text/css">.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; }
</style>
</p><pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> nonRecursivePostOrder(Node root)
{
var toVisit = <span class="kwrd">new</span> Stack&lt;Node&gt;();
var visitedAncestors = <span class="kwrd">new</span> Stack&lt;Node&gt;();
toVisit.Push(root);
<span class="kwrd">while</span> (toVisit.Count &gt; 0)
{
var node = toVisit.Peek();
<span class="kwrd">if</span> (node.Children.Count &gt; 0)
{
<span class="rem">// PeekOrDefault is an extension helper, see full program below</span>
<span class="kwrd">if</span> (visitedAncestors.PeekOrDefault() != node)
{
visitedAncestors.Push(node);
toVisit.PushReverse(node.Children); <span class="rem">// PushReverse is a helper, see full program below</span>
<span class="kwrd">continue</span>;
}
visitedAncestors.Pop();
}
Console.Write(node.Id);
toVisit.Pop();
}
}</pre>
<style type="text/css">.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; }
</style>
<p>The idea is here is to, in addition to the normal DFS toVisit stack, keep a visitedAncestors stack.&nbsp; In the depth first traversal when we encounter a parent node (node.Children.Count &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).&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.&nbsp; </p>
<p>There are multiple algorithms out there to accomplish this.&nbsp; Several of my colleagues sent me their versions.&nbsp; One version kept the state of child enumeration in the stack along with the node in the toVisit stack.&nbsp; Another similarly used a structure in the toVisit stack that had a visited boolean along with the node.&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).&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.&nbsp; If there is interest I can likely publish these algorigthms as well.&nbsp; What I am not sure of is whether there is a canonical “best” (complexity, space) algorithm for a non-recursive post order traversal.&nbsp;&nbsp; </p>
<p>Here is a full sample program with the helper methods and sample tree data structure:</p><pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Linq;
<span class="kwrd">namespace</span> ConsoleApplication2
{
<span class="kwrd">class</span> Program
{
<span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
{
<span class="rem">// a</span>
<span class="rem">// b c d</span>
<span class="rem">// e f g h i</span>
<span class="rem">// dfs: efbgchida</span>
var root = makeTree();
nonRecursivePostOrder(root);
Console.WriteLine();
}
<span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> nonRecursivePostOrder(Node root)
{
var toVisit = <span class="kwrd">new</span> Stack&lt;Node&gt;();
var visitedAncestors = <span class="kwrd">new</span> Stack&lt;Node&gt;();
toVisit.Push(root);
<span class="kwrd">while</span> (toVisit.Count &gt; 0)
{
var node = toVisit.Peek();
<span class="kwrd">if</span> (node.Children.Count &gt; 0)
{
<span class="kwrd">if</span> (visitedAncestors.PeekOrDefault() != node)
{
visitedAncestors.Push(node);
toVisit.PushReverse(node.Children);
<span class="kwrd">continue</span>;
}
visitedAncestors.Pop();
}
Console.Write(node.Id);
toVisit.Pop();
}
}
<span class="kwrd">private</span> <span class="kwrd">static</span> Node makeTree()
{
var e = <span class="kwrd">new</span> Node(<span class="str">"e"</span>);
var f = <span class="kwrd">new</span> Node(<span class="str">"f"</span>);
var b = <span class="kwrd">new</span> Node(<span class="str">"b"</span>, <span class="kwrd">new</span> List&lt;Node&gt; { e, f });
var g = <span class="kwrd">new</span> Node(<span class="str">"g"</span>);
var c = <span class="kwrd">new</span> Node(<span class="str">"c"</span>, <span class="kwrd">new</span> List&lt;Node&gt; { g });
var h = <span class="kwrd">new</span> Node(<span class="str">"h"</span>);
var i = <span class="kwrd">new</span> Node(<span class="str">"i"</span>);
var d = <span class="kwrd">new</span> Node(<span class="str">"d"</span>, <span class="kwrd">new</span> List&lt;Node&gt; { h, i });
var a = <span class="kwrd">new</span> Node(<span class="str">"a"</span>, <span class="kwrd">new</span> List&lt;Node&gt; { b, c, d });
<span class="kwrd">return</span> a;
}
}
<span class="kwrd">static</span> <span class="kwrd">class</span> StackHelper
{
<span class="kwrd">public</span> <span class="kwrd">static</span> Node PeekOrDefault(<span class="kwrd">this</span> Stack&lt;Node&gt; s)
{
<span class="kwrd">return</span> s.Count == 0 ? <span class="kwrd">null</span> : s.Peek();
}
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> PushReverse(<span class="kwrd">this</span> Stack&lt;Node&gt; s, List&lt;Node&gt; list)
{
<span class="kwrd">foreach</span> (var l <span class="kwrd">in</span> list.ToArray().Reverse())
{
s.Push(l);
}
}
}
<span class="kwrd">class</span> Node
{
<span class="kwrd">public</span> <span class="kwrd">string</span> Id;
<span class="kwrd">public</span> List&lt;Node&gt; Children;
<span class="kwrd">public</span> Node(<span class="kwrd">string</span> id)
{
Id = id;
Children = <span class="kwrd">new</span> List&lt;Node&gt;();
}
<span class="kwrd">public</span> Node(<span class="kwrd">string</span> id, List&lt;Node&gt; children)
{
Id = id;
Children = children;
}
<span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> Equals(<span class="kwrd">object</span> obj)
{
var node = obj <span class="kwrd">as</span> Node;
<span class="kwrd">if</span> (node != <span class="kwrd">null</span>)
{
<span class="kwrd">return</span> node.Id == <span class="kwrd">this</span>.Id;
}
<span class="kwrd">return</span> <span class="kwrd">false</span>;
}
<span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">int</span> GetHashCode()
{
<span class="kwrd">return</span> Id.GetHashCode();
}
}
}
</pre>
<style type="text/css">.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; }
</style><img src="http://blogs.msdn.com/aggbug.aspx?PostID=9979721" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxMeeting Mike Vincenthttp://blogs.msdn.com/b/daveremy/archive/2008/09/16/meeting-mike-vincent.aspx2008-09-16T20:15:26Z2008-09-16T20:15:26Z<p>(This a cross-post from remlog.net: <a title="http://blog.remlog.net/?p=33" href="http://blog.remlog.net/?p=33">http://blog.remlog.net/?p=33</a>) <p>Yesterday, I had the pleasure of meeting <a href="http://mvasoftware.com/blogs/mikev_weblog/archive/2008/07/03/teched-recap.aspx">Mike Vincent</a>, who is on the Board of Directors of <a href="http://www.ineta.org/">INETA</a> (International .NET Association) which works to coordinate a huge community of .NET user groups.&nbsp;&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. <p>Mike was in town for an INETA board meeting, the <a href="http://msdn.microsoft.com/en-us/vsx/cc512752.aspx">Visual Studio Extensibility (VSX) Conference</a> and to meet with various MS product teams to see how we could work together to improve the .NET User group experience. <p>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. <p>One question we asked was how important Mike saw Visual Studio Integration for the Iron languages.&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.&nbsp; Others tell us, make sure that we integrate well with VS now since this is their primary code editing tool.&nbsp; Mike's response was that VS integration is "a big deal" for adoption by the mainstream .NET developer and consequently a must have.&nbsp;&nbsp; <p>Mike mentioned a cool concept that INETA is embarking on around speakers.&nbsp; INETA is known for its <a href="http://www.ineta.org/Speakers/Speakers.aspx">speaker's bureau</a> (and virtual user groups) which has been national&nbsp; in scope.&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.&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.&nbsp; Mike also mentioned that INETA is also heavily encouraging virtual presentations, recording live presentations, and having them available via the INETA website.&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. <p>I asked Mike how he viewed dynamic languages in .NET.&nbsp;&nbsp; The value he sees is that advantage of providing&nbsp; more tools for the .NET developer's toolbelt.&nbsp; "Dynamic languages allow you to do some things much more easily than a static language".&nbsp; The low ceremony aspects of IronPython and IronRuby in particular help.&nbsp; <p>Mike has special interest in a project to allow NUnit tests to be written in IronPython.&nbsp;&nbsp; Using the low ceremony language like IronPython can make this feel very much like a <a href="http://en.wikipedia.org/wiki/Domain_Specific_Language">DSL</a> for testing.&nbsp; We didn't get a chance to talk about it much but I look forward to learning more about it.&nbsp; Harry has some ideas for how the IronPython team might be able to help. <p>I asked Mike what the major issues with .NET and in his constituent user communities.&nbsp;&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).&nbsp;&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.&nbsp;&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.&nbsp; Perhaps, we strategized, Microsoft should do more to innovate around helping customers move successfully from one .NET release to the next. <p>It was great to meet Mike and hear about more about INETA.&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.&nbsp;&nbsp; I look forward to working with Mike and INETA to improve the .NET user group experience as well as .NET developers in general. <p>Rem <img src="http://blogs.msdn.com/aggbug.aspx?PostID=8954146" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxLunch with a Dynamics Languages Braintrusthttp://blogs.msdn.com/b/daveremy/archive/2008/09/15/lunch-with-a-dynamics-language-braintrust.aspx2008-09-15T23:39:01Z2008-09-15T23:39:01Z<p>One of the biggest privileges I have is the quality of people I get to hang out with here at Microsoft.&nbsp; Within the Visual Studio Languages GO team and the <a href="http://en.wikipedia.org/wiki/Dynamic_Language_Runtime">DLR</a> 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.&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.&nbsp; Not just technical stuff.&nbsp; A big subject of today's lunch was <a href="http://blogs.msdn.com/dinoviehland/archive/2008/03/17/ironpython-ms-sql-and-pep-249.aspx">Dino</a>'s trip to <a href="http://www.burningman.com/">Burning Man</a> (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 <a href="http://www.nbc.com/Saturday_Night_Live/video/clips/palin-hillary-open/656281/">Tina Fey's portrayal of Sarah Palin</a>.&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.&nbsp; </p> <p>I took some pictures around the table at lunch today.&nbsp; Ok, they don't look like a brain trust with their mouths full but believe me these guys are the sh*t.</p> <p><a href="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0008_2.jpg"><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"></a> </p> <p><a href="http://blogs.msdn.com/curth/default.aspx">Curt</a> (IronCurt, Dev on IronPython and IronRuby), <a href="http://www.iunknown.com/">John</a> (IronRuby PM), and <a href="http://tmd.havit.cz/">Tomas</a> (Lead Dev on IronRuby).</p> <p><a href="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0009_2.jpg"><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"></a> </p> <p><a href="http://blog.jredville.com/">Jim</a> (Tester IronRuby), <a href="http://blogs.msdn.com/dinoviehland/archive/2008/03/17/ironpython-ms-sql-and-pep-249.aspx">Dino</a> (Lead Dev on IronPython), and <a href="http://www.devhawk.net/">Harry</a> (PM for IronPython)</p> <p><a href="http://blogs.msdn.com/blogfiles/daveremy/WindowsLiveWriter/LunchwithaDynamicsLanguageBraintrust_BFE4/PIC-0010_2.jpg"><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"></a> </p> <p><a href="http://blog.jimmy.schementi.com/">Jimmy</a> (PM on all sorts of IronRuby and IronPython stuff), <a href="http://msdn.microsoft.com/en-us/magazine/cc300886.aspx">Bill</a> (PM for DLR), and me.</p> <p>I can think of many times in my career when I would not attend these types of lunches.&nbsp; Too much work to do.&nbsp; Funny thing, I think I got more accomplished at lunch today than two of my scheduled meetings.</p> <p>rem</p><img src="http://blogs.msdn.com/aggbug.aspx?PostID=8953065" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxSapir-Whorf Revisitedhttp://blogs.msdn.com/b/daveremy/archive/2008/08/07/sapir-whorf-revisited.aspx2008-08-07T21:37:54Z2008-08-07T21:37:54Z<p>This is a cross post from my blog (<a href="http://blog.remlog.net">http://blog.remlog.net</a>) here: <a title="http://blog.remlog.net/?p=5" href="http://blog.remlog.net/?p=5">http://blog.remlog.net/?p=5</a></p> <p>A friend from Microsoft reminded me of a post I did on my MSDN blog when I was previously at Microsoft on the <a href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis">Sapir-Whorf hypothesis</a> (roughly, the hypothesis that your language shapes your view of reality) and its application to programming languages.&nbsp; The blog was: <a href="http://blogs.msdn.com/daveremy/archive/2005/04/06/sapirwhorfs.aspx">The Sapir-Whorf hypothesis. Does program language “centricity” limit you?</a>&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 <a href="http://research.microsoft.com/~emeijer/">Erik Meier</a> and <a href="http://www.uni-koblenz.de/~laemmel/Site/Home.html">Ralf Lammel</a>).&nbsp;&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).</p> <p>By the way, it appears that Sapir-Whorf has more acceptance in programming languages and methodologies than it does in psycho-linguists circles (<a href="http://talklikeaduck.denhaven2.com/articles/2007/06/11/sapir-whorf">here</a>, and <a href="http://www.aber.ac.uk/media/Students/njp0001.html">here</a>) at least at the extreme end of the&nbsp; language determinism spectrum.</p> <p>On another note Sapir-Whorf is being invoked regularly in relation to <a href="http://en.wikipedia.org/wiki/Behavior_driven_development">Behavior Driven Development</a> (BDD) as implemented in <a href="http://rspec.info/">RSpec</a> the popular ruby testing framework.&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.&nbsp;&nbsp;&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.&nbsp; There are many <a href="http://www.agilejournal.com/content/view/597/76/">articles</a> and <a href="http://www.lukeredpath.co.uk/2006/8/29/developing-a-rails-model-using-bdd-and-rspec-part-1">blogs</a>&nbsp; (just web search 'rspec sapir-worf') linking RSpec to the Sapir-Whorf hypothesis (many of them pretty in a pretty cavalier manner) .&nbsp; The general idea appears to be that because BDD changes the words for writing&nbsp; "tests" (whoops, I used the wrong word there), I mean "specifications", which in turn influences the developer's to think differently about tests.&nbsp;&nbsp; I generally agree with the conclusion, we are using a variation of RSpec to test <a href="http://www.ironruby.net/">IronRuby</a> completion and we think of it very much like a language specification,&nbsp; however I am not so sure that Sapir-Whorf is the right theory to support this change in perception.&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.&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".&nbsp; RSpec is really influencing a <a href="http://en.wikipedia.org/wiki/Mindset">mindset</a> 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 <a href="http://en.wikipedia.org/wiki/Mindset">wikipedia entry for mindset</a>).&nbsp;&nbsp; I like the response that John Roth gave <a href="http://tech.groups.yahoo.com/group/extremeprogramming/message/113260">here</a> along these lines.&nbsp; This is all just quibbling though.&nbsp; RSpec is a most excellent step forward.</p> <p>rem</p><img src="http://blogs.msdn.com/aggbug.aspx?PostID=8841456" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxBack To Microsofthttp://blogs.msdn.com/b/daveremy/archive/2008/08/07/back-to-microsoft.aspx2008-08-07T21:28:00Z2008-08-07T21:28:00Z<P>I am back at Microsoft!&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 <A class="" title=uboost href="http://www.uboost.com/" mce_href="http://www.uboost.com">uboost</A>&nbsp;based in Honolulu.&nbsp; I recently came back to be Lead Program Manager on the Visual Studio Languages Growth Opportunity (GO) team.&nbsp; If you are interested I wrote a blog on my experience on my blog at <A href="http://blog.remlog.net/">http://blog.remlog.net</A> <A class="" title="Back To Microsoft" href="http://blog.remlog.net/?p=4" mce_href="http://blog.remlog.net/?p=4">here</A>.</P>
<P>&nbsp;I am having a great time getting getting geeked out on languages and working with a tremendous team.&nbsp; More blogs on my personal blog and crossposted here where it makes sense.</P>
<P>&nbsp;Dave</P><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=8841453" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxChanging status, moving forwardhttp://blogs.msdn.com/b/daveremy/archive/2006/06/16/david.aspx2006-06-16T20:36:00Z2006-06-16T20:36:00Z<P>A&nbsp;quick note about what I am up to these days.&nbsp; Lots of folks have been asking me if I am going to ever blog again -&nbsp;for good reason considering the timing of my blogs so far, but, yes, I plan to get started again.&nbsp; My friend and guy in the office next door at Microsoft, Ralf Lammel, has started his new blog (<A href="http://blogs.msdn.com/ralflammel/">http://blogs.msdn.com/ralflammel/</A>) so perhaps that will inspire me.&nbsp; I love to read Ralf's papers and email (and I am sure blogs) since he&nbsp;writes in his own&nbsp; interesting, quirky style.&nbsp; Ralf came over from Germany and speaks German natively but I'm not sure that completely explains his style :)&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.&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.&nbsp; </P>
<P>My role at Microsof has changed a bit in the last few months.&nbsp; For awhile there I was&nbsp;the program manager for XLinq (XML Language Integrated Query) technology which is the XML specific implementation for LINQ (<A href="http://msdn.microsoft.com/data/ref/linq/">http://msdn.microsoft.com/data/ref/linq/</A>) then, for a briefly (a few months) I took on the Group Program Manager role for the XML team.&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.&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.&nbsp; I look forward to doing some future blogs in these areas.&nbsp; So far I&nbsp;reeeaaally enjoy working with these technologies.&nbsp; I have already&nbsp;had&nbsp;the chance to work with XLinq quite a&nbsp;bit and&nbsp;so I knew what a pleasure it is to write XML code&nbsp;in that technology (who would of thought - a "pleasure" to write XML code?).&nbsp; WPF is quite a bit&nbsp;different&nbsp;but I am super impressed.&nbsp; From my perspective it has a consistency of architecture and composability that makes it super powerful yet very approachable.&nbsp; The big challenge with WPF is there are not yet mature tools for it and the community around it is just forming.&nbsp; So when you run into an issue it is often not as simple as just doing a web search to find the answer.&nbsp; Also there is not a huge amount of documentation out there yet (although <A href="http://www.amazon.com/gp/product/0596101139/103-3546045-9172639?v=glance&amp;n=283155 ">Chris Sells book</A> is really good).&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.&nbsp; </P>
<P>The other big thing that is going on with me is that I am doing <A href="http://www.ironmancda.com/">Ironman Coeur D'Alene </A>on June 25.&nbsp; Which is about 8 days from now.&nbsp; I have done the "iron training" and should feel confident but I have to admit I am freaking out a bit.&nbsp; If you want to follow my progress (for some strange reason) it should be available on <A href="http://ironman.com/ironmanlive/racedaycoverage/livetrackinginfo">Ironman Live </A>&nbsp;(my number is: 1455).&nbsp; I will definitely be slow.&nbsp; I am guessing 14 hours or so but I really have no idea.&nbsp; I just hope to finish ...</P>
<P>A week later my wife and I&nbsp;are heading over to Tuscany, Italy for a two week bike trip from Fiorenza (a.k.a., Florence) to Rome.&nbsp; I hope I can ride by then!</P>
<P>Anyway, more blogs soon although&nbsp; I suspect I will have a hard time keeping up with Ralf.</P>
<P>thanks! rem</P><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=634391" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxXNames and Expanded Nameshttp://blogs.msdn.com/b/daveremy/archive/2005/09/22/473126.aspx2005-09-23T05:51:00Z2005-09-23T05:51:00Z<P>At&nbsp; my <A href="http://216.55.183.63/pdc2005/slides/DAT324_Remy.ppt">XLinq PDC2005 talk </A>and in the <A href="http://msdn.microsoft.com/VBasic/Future/XLinq%20Overview.doc"><STRONG>XLinq Overview Document</STRONG></A><STRONG>&nbsp;</STRONG>one of the differences I mentioned between XLinq and DOM is the treatment of XML Names in XLinq.&nbsp; XLinq's abstraction for XML Names is a class called <STRONG>XName</STRONG> which is the only way an XML Name shows up anywhere in the API.&nbsp; You seldom have to construct an XName since there is an implicit conversion from string.&nbsp; For example to construct an XElement with a local name Foo that has a namespace of <A href="http://mycompany.com/">http://myCompany.com</A> you could do the following:</P>
<P>XElement foo = new XElement("<STRONG>{http://myCompany.com}Foo</STRONG>",&nbsp; ... any value or children of Foo ...);</P>
<P>So what is that string there with the curly braces in the constructor you ask?&nbsp; XLinq calls it&nbsp;the <EM>Expanded Name</EM>.&nbsp; This idea is very much inspired by James Clark's paper on <A href="http://www.jclark.com/xml/xmlns.htm">XML Namespaces </A>in which he talks about <EM>Universal Names</EM>&nbsp;defined as a local name and a qualifying URI.&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).&nbsp;&nbsp; He&nbsp;gives example in his paper of how default namespaces and prefixes map into&nbsp;Universal Names.&nbsp; </P>
<P>This is essentially what XLinq does in&nbsp;its API.&nbsp;&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.&nbsp;&nbsp; Namespace declarations (xmlns attributes) are retained as attributes in the in-memory tree and on output are&nbsp;used to associate prefixes with namespaces all over again.&nbsp; In other words from XLinq's perspective default namespace declarations and prefix declarations are purely serialization options.&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.&nbsp; There are helper methods in XLinq&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.&nbsp; The only trick is knowing the namespace of the xmlns attribute (<A href="http://www.w3.org/2000/xmlns">http://www.w3.org/2000/xmlns</A>).&nbsp; For example to declare the prefix ns and associate it with <A href="http://myCompany.com">http://myCompany.com</A> you could add the following attribute where you want it defined.</P>
<P><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">new</SPAN><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"> <SPAN style="COLOR: teal">XAttribute</SPAN>(<SPAN style="COLOR: maroon">"{http://www.w3.org/2000/xmlns/}ns"</SPAN>,<SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="COLOR: maroon"><A href="http://myCompany.com">http://myCompany.com</A></SPAN>),</SPAN></P>
<P><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"><FONT size=3>Anyway, I think James Clarks article on XML Namespaces is one of the better explanations on the subject&nbsp;and&nbsp;understanding&nbsp;that XML Names are really&nbsp;namespace+local name simplifies&nbsp;working with names in&nbsp;XLinq.&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.</FONT></SPAN></P>
<P><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"><FONT size=3>This is an area we are looking for feedback.&nbsp; Lemme know what you think.</FONT></SPAN></P>
<P><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"><FONT size=3>cya,<BR>rem</FONT></SPAN><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"><BR style="mso-special-character: line-break"></P></SPAN><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=473126" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxAnders unveils LINQ! (and XLinq)http://blogs.msdn.com/b/daveremy/archive/2005/09/13/465006.aspx2005-09-13T22:29:00Z2005-09-13T22:29:00Z<P>In Jim Allchin's keynote At PDC2005 today Anders Hejlsberg showed the LINQ project for the first time.&nbsp; LINQ stands for Language Integrated Query.&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.&nbsp; Out of the box there are three LINQ enabled data access technologies that are being shown at PDC.&nbsp; The first is any in-memory .NET collection that you foreach over (any .NET collection that implements IEnumerable&lt;T&gt;).&nbsp; The second is DLinq which provides LINQ over a strongly typed relational database layer.&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.&nbsp; It is great to get the chance to get this technology to the next stage of development and get&nbsp;all of you&nbsp;involved.&nbsp; The LINQ Preview bits (incuding XLinq and DLinq) are being made available to PDC attendees.&nbsp; More information on the LINQ project (including &nbsp;the preview bits) are also available online at <A href="http://msdn.microsoft.com/netframework/future/linq">http://msdn.microsoft.com/netframework/future/linq</A>.&nbsp;&nbsp;&nbsp; </P>
<P>More specifically about XLinq, XLinq is a new in-memory XML programming API that is LINQ enabled.&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.&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&lt;T&gt;.&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 -&nbsp;operators like Descendants, Ancestors, Parent, etc.&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).&nbsp;&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.&nbsp; There is&nbsp;an Xlinq overview doc that is posted on the LINQ Project site.&nbsp; Here is a direct link: <A href="http://download.microsoft.com/download/c/f/b/cfbbc093-f3b3-4fdb-a170-604db2e29e99/XLinq%20Overview.doc">http://download.microsoft.com/download/c/f/b/cfbbc093-f3b3-4fdb-a170-604db2e29e99/XLinq%20Overview.doc</A>.&nbsp; </P>
<P>Anders has a detailed presentation tomorrow on LINQ and I am presenting more on XLinq on Friday.&nbsp; I'll post more details over the days and weeks ahead.&nbsp; I look forward to your feedback!</P>
<P>rem</P><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=465006" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxPDC prez: The .NET Language Integrated Query Framework with XML Datahttp://blogs.msdn.com/b/daveremy/archive/2005/09/01/459381.aspx2005-09-02T00:02:00Z2005-09-02T00:02:00Z<P>I will be doing a presentation at PDC this year on&nbsp;Using the .NET Language Integrated Query Framework with XML Data.&nbsp; The presentation is on Friday (8/16) at 10:30.&nbsp; Hope to see you there!</P>
<P>Here is the abstract:</P>
<P><EM><FONT color=#000000>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.</FONT></EM></P>
<P>Luca is doing a talk on Using the .NET Language Integrated Framework with Relational Data and blogs about it here:&nbsp; <a href="http://blogs.msdn.com/lucabol/archive/2005/07/14/438824.aspx">http://blogs.msdn.com/lucabol/archive/2005/07/14/438824.aspx</A>&nbsp;</P><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=459381" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxThe Sapir-Whorf hypothesis. Does program language “centricity” limit you?http://blogs.msdn.com/b/daveremy/archive/2005/04/06/sapirwhorfs.aspx2005-04-07T01:33:00Z2005-04-07T01:33:00Z<DIV class=Section1>
<P class=MsoNormal>I recently came over from the Java world to work at Microsoft as a program manager on the <a href="http://blogs.msdn.com/xmlteam/">XML team at Microsoft</A>.&nbsp; From my experience with BEA (and prior) I was a “java centric” developer.&nbsp;&nbsp; I had academic exposure to C++ and some practical exposure to VB, ASP, and a few other languages, but my focus was Java.&nbsp;&nbsp; For me that meant, when I thought in code, I thought in Java.&nbsp; When I looked at code in another language I would interpret it into Java.&nbsp; “Ah, this is the same as a package in Java, or, I’ve never seen anything like that in Java!&nbsp; Crazy …”.&nbsp;&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.&nbsp; Frankly, I figured if it wasn’t covered by Java it probably wasn’t that important to learn.</P>
<P class=MsoNormal>A confluence of events recently has me thinking about this “language centric” approach to personal growth as a software developer.&nbsp;&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.&nbsp; Like many in the Java world, I looked at C# as a Java knock off that would be simple to pick up.&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.&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, … (<A href="http://www.25hoursaday.com/CsharpVsJava.html#namespace">See Dare Obsanjo’s article on the comparison between Java and C#</A>) accumulate such that I began to realize that C# is not just Java warmed over but represents a similar but different “<A href="http://en.wikipedia.org/wiki/World_view">world view</A>” of software development.&nbsp; </P>
<P class=MsoNormal>Working at Microsoft I have the incredible opportunity to work with people such as <A href="http://research.microsoft.com/~emeijer/">Erik Meijer</A> (C Omega, Haskell DB, much more), <A href="http://en.wikipedia.org/wiki/Anders_Hejlsberg">Anders Hejlsberg</A> (C#, .NET, Delphi, Turbo Pascal, much more), and <A href="http://homepages.cwi.nl/~ralf/">Ralf Lammel</A> who challenge me to think outside the Java/imperative programming box. &nbsp;&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.&nbsp; </P>
<P class=MsoNormal>A professor of mine at DePaul, <A href="http://facweb.cs.depaul.edu/jrogers/">Dr. John Rodgers</A>, introduced the <A href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesishttp:/en.wikipedia.org/wiki/Sapir-Whorf_hypothesis">Sapir-Whorf hypothesis</A> to me recently.&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].&nbsp;&nbsp; The linguistic hypothesis applies directly to programming languages.&nbsp; The idea is “when designing an algorithm to solve a particular algorithm, programmers are heavily influenced by the language constructs available.”[2]&nbsp; A part of this could be just the <I>friction</I> necessary to implement certain programming concepts in different languages however there is more to it.&nbsp;&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.&nbsp; Needless to say there was a LOT of friction to build that system.&nbsp;&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.&nbsp; This is similar to the issue pointed out by Benjamin Whorf of Eskimos thinking about camels or the Sahara desert.&nbsp; They may have <A href="http://rec-puzzles.org/new/sol.pl/trivia/eskimo.snow">20 words for snow</A> 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. &nbsp;&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).&nbsp; (Ralf pointed out to me that COBOL has had an object oriented version since 1994, but, ahem, this was before that ...).</P>
<P class=MsoNormal>I am realizing, at least for me, that working with C#, VB.Net, research languages like <A href="http://www.eweek.com/article2/0,1759,1683952,00.asp">SpecSharp</A> and <A href="http://research.microsoft.com/Comega/">C Omega</A>, functional languages such as <A href="http://www.dcs.napier.ac.uk/course-notes/sml/manual.html">ML</A> and <A href="http://www.haskell.org/">Haskell</A> (yes, I know Erik and Ralf, Haskell is waaaay superior to ML ;)), and dynamic languages such as <A href="file:///p:/www.cpan.org/">Perl</A> and <A href="http://www.ruby-lang.org/en/">Ruby</A> contain critical lessons for my growth as a software developer.&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.&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.</P>
<P class=MsoNormal>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.&nbsp; I am not making that argument, although it might be true, and I do believe that multi-language support is a good thing.&nbsp; However, the CLR itself embodies a paradigm that influences and constrains the languages that are built on top of it.&nbsp; The risks of language centricity apply to .NET centricity as well (although at a higher level of abstraction).&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 <A href="http://www.ironpython.com/">IronPython</A>).&nbsp; Also, I see these concepts being weighed in the language design of .NET languages like C# and VB.NET.&nbsp; For example C# 2.0 has been influenced by functional programming languages and I anticipate C# 3.0 will be as well.&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&nbsp; (many languages are ported are being ported to CLR), and consequently influence the different CLR languages that have these new <I>inspired </I>underlying features available.&nbsp;&nbsp; </P>
<P class=MsoNormal>My personal take away out of this is that language centricity was not the only or best strategy for growing as a software developer.&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.&nbsp; </P>
<P class=MsoNormal>Are you limiting yourself by focusing exclusively on one language?</P>
<P class=MsoNormal><B>Other reading:</B></P>
<P class=MsoNormal>[1] Sapir-Whorf hypothesis, <A href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis">http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis</A> </P>
<P class=MsoNormal>[1.1] On the Sapir-Whorf hypothesis and its relation to programming languages, <A href="http://www.cerezo.name/archives/000005.html">http://www.cerezo.name/archives/000005.html</A> </P>
<P class=MsoNormal>[2] Sapir-Whorf and programming languages, David Cerezo’s Weblog, &nbsp;<A href="http://en.wikipedia.org/wiki/Sapir-Whorf_and_programming_languages">http://en.wikipedia.org/wiki/Sapir-Whorf_and_programming_languages</A> </P>
<P class=MsoNormal>[3] Edward Sapir, <A href="http://www.yale.edu/linguist/Sapir.html">http://www.yale.edu/linguist/Sapir.html</A></P>
<P class=MsoNormal>[4] Benjamin Whorf, <A href="http://mtsu32.mtsu.edu:11072/Whorf/mindblw.htm">http://mtsu32.mtsu.edu:11072/Whorf/mindblw.htm</A></P>
<P class=MsoNormal>[5] The Language List, <A href="http://people.ku.edu/~nkinners/LangList/Extras/langlist.htm">http://people.ku.edu/~nkinners/LangList/Extras/langlist.htm</A> Collected information on about 2500 Computer Languages, Past and Present</P>
<P class=MsoNormal>[6] History of Programming Languages, O’Reilly Poster, <A href="http://www.oreilly.com/news/graphics/prog_lang_poster.pdf">http://www.oreilly.com/news/graphics/prog_lang_poster.pdf</A></P>
<P class=MsoNormal>[7] Computer Languages History: <A href="http://www.levenez.com/lang/">http://www.levenez.com/lang/</A></P>
<P class=MsoNormal>&nbsp;</P></DIV><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=405987" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxLogicalis and Washington Dep of Licensing visits XML Teamhttp://blogs.msdn.com/b/daveremy/archive/2005/01/25/360424.aspx2005-01-25T22:08:00Z2005-01-25T22:08:00Z<p>It was great to have Logicalis up to Building 35 Friday (1/21/05) to talk to the XML team about the National Motor Vehicle Title Information System Project that they have been working in conjunction with the Washington State Department of Licensing.&nbsp; Thanks to Dan Remy (yup, my brother), Corey Snow, Bill Baxter, and Mike O'Shea from Logicalis as well as <span class="720335121"><font face="Arial" color="#000000" size="2">Linda Rae, </font></span><span class="720335121"><font face="Arial" color="#0000ff" size="2"><font color="#000000">Jeff Crose and Holly Burch from Washington State Department of Licensing.&nbsp; Dan described the architecture of the system highlighting the big technical challenges that were overcome by use of System.Xml functionality.&nbsp; Corey showed some signifcant XSLT work that he had done on the system (with lots of comments about looking forward to the XSLT debugger in Whidbey).&nbsp; Mike then showed us a graphing component that made significant use of XML technologies.&nbsp; It was an impressive system and it was great for the XML team to get a chance to learn about how XML technologies are getting used, what the underlying motivations resulting in XML usage, and some interesting ideas on how we can do better.&nbsp; Thanks very much Dan, Corey, Jeff, Bill, Mike, Linda, and Holly.&nbsp; We wish you all the success in the world and would like to keep in regular touch with you to get feedback.</font></font></span></p> <p><span class="720335121">BTW, we are always looking for real world XML customer scenarios so if you are a customer using&nbsp;.NET System.XML&nbsp;technology (or MSXML) extensively&nbsp;or perhaps a consultant with a customer that is we would love to talk with you.&nbsp; Perhaps you would be interested in giving a talk to the MS XML Team like Logicalis did.&nbsp;</span></p> <p><span class="720335121">rem</span></p> <p><span class="720335121"></span><span class="720335121">Here is the announcement I sent out to the XML team about the Logicalis talk ....</span></p> <p> <table cellspacing="1" cellpadding="7" width="590" border="1"> <tbody> <tr> <td width="50%"><b><font face="Times New Roman"> <p>Dan Remy and Corey Snow</b> from <b>Logicalis</b> will share with us information about their successful .NET based <b>National Motor Vehicle Title Information System (NMVTIS)</b>. It features use of System.XML as well as use of native XSLT amongst other technologies. </p></font></td> <td width="50%"><font face="Times New Roman"> <p align="center">&nbsp;</p></font></td></tr> <tr> <td colspan="2"><b><font face="Times New Roman"> <p>Mike O’Shea</b> from <b>Logicalis</b> will also present a charting tool that can be used on the web or in Windows Forms written using C#, VB.NET, ASP.NET, XSLT, XPath, XML, and JScript.</font></p></td></tr> <tr> <td colspan="2">&nbsp;</td></tr> <tr> <td colspan="2"><b><font face="Times New Roman"> <p>About Logicalis:</p></b> <p>Logicalis is international company based out of London, England. Specializing in the following areas:</p> <dir> <dir> <p>Application Development and Integration </p> <p>Infrastructure Services (CISCO Gold Partner) </p> <p>Managed Services</p></dir></dir><i> <p>From their website</i>: Logicalis Group has over 5,000 customers including many of the world’s leading companies and a large number of public sector organisations. We employ over a thousand employees dedicated to delivering high-performance, cost-efficient and robust IT infrastructures to enable our customers’ critical business applications to run effectively</font></p></td></tr> <tr> <td colspan="2">&nbsp;</td></tr> <tr> <td colspan="2"><b><font face="Times New Roman"> <p>About The National Motor Vehicle Title Information System (NMVTIS) Project:</p></b> <p>This is the State of Washington Department of Licensing's effort to participate in the federal NMVTIS program. The national NMVTIS system tracks Vehicle Title and Brand information across states to help detect fraudulent activities. NMVTIS also provides a ability to perform theft inquiries to check for stolen vehicles. </p> <p></p> <p>The NMVTIS interface requires states to generate and interpret transactions in variety of formats. One of our challenges was to simply this interface for state application use. Using XML, we managed to completely abstract the federal formats from the state applications.</p> <p></p> <p>We built an NMVTIS Help Desk application using ASP.net &amp; VB.net that allows the operator to submit any NMVTIS transaction request online to the national system. All requests go through a web service that uses XML schemas for validating the request XML format. Additionally, we used some elaborate XSLT to dynamically format and display any response returned from an NMVTIS requests. It turned out great!</font></p></td></tr> <tr> <td colspan="2">&nbsp;</td></tr> <tr> <td colspan="2"><b><font face="Times New Roman"> <p>About the participants:</p> <p>Dan Remy</b> - Managing Consultant, Lead Technician and Architect on the NMVTIS project. Specializes is leading the business team through requirements and design; and then leading the technical team through construction and implementation (primarily Microsoft technologies).</p> <p></p><b> <p>Corey Snow</b> - Senior Consultant. Specializes in security and .Net technologies... he is the mastermind behind the NMVTIS Response display processing. Excellent with XML core technologies.</font></p></td></tr></tbody></table></p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=360424" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxXML Attributes and XML Schemahttp://blogs.msdn.com/b/daveremy/archive/2005/01/21/358521.aspx2005-01-22T02:01:00Z2005-01-22T02:01:00ZRecently I was researching an issue submitted by <A href="http://weblogs.asp.net/cazzu/">Daniel Cazzulino</a> to the XML team about a problem that he ran into <A href="http://weblogs.asp.net/cazzu/posts/XsdAndXInclude.aspx">using XInclude and XML Schema together</a>. &nbsp; As you probably know you can use <a href="http://www.w3.org/TR/2004/REC-xinclude-20041220/">XInclude</a> in XML instances to bring XML into a document from different locations.&nbsp; After a piece of XML is XIncluded an xml:base attribute is left on the element to allow for round tripping in edit scenarios.&nbsp; The problem arises when attempting to validate the resulting XML instance.&nbsp; XML Schema treats xml attributes (attributes defined in the http://www.w3.org/XML/1998/namespace) just like any other attribute, meaning that the xml:base that XInclude leaves behind must be defined in the content model of the element that was XIncluded.&nbsp; Thus an XML Schema author would need to anticipate any place in an instance that could be XIncluded and add an xml:base (or perhaps anyAttribute with namespace=http://www.w3.org/XML/1998/namespace). &nbsp; The result of this, at least from what I have learned so far, is that the interaction between XInclude and XML Schema is substantially hampered (is broken an overstatement?).<br /> <br /> I've talked to various people about this issue and no has been able to give me a very good justification why the xml attributes (currently xml:lang, xml:space, xml:base with xml:id coming) are not treated in more of a lax way by XML Schema.&nbsp; As you probably know the <a href="http://www.w3.org/XML/1998/namespace.html">xml namespace</a> is implicitly defined in an XML instance and the xml prefix is reserved for this namespace.&nbsp; Schema however has no special treatment of XML attributes.&nbsp; I posted about this to the W3C Schema Interest group (W3C member only list) and <a href="http://www.ltg.ed.ac.uk/%7Eht/">Henry Thompson</a> gave a reasonable response that this was a carry over from XML 1.0 where DTDs required that xml attributes be in the appropriate ATTLISTs but also commented, in hindsight, this issue is probably something to look into further.<br /> <br /> My thinking on this now is that it would be best if XML Schema would treat xml attributes laxly meaning something like:<br /> <ol> <li>If an xml attribute is encountered in an instance and it is NOT defined in the content model then validate the data type only (e.g., validate that xml:base is anyURI) against the xml namespace schema.&nbsp; This data type validation would assure that it really is an XML attribute and that the instance data at least conformed to the data typed defined.<br /> </li> <li>If an xml attribute is encountered in an instance and it is defined in the content model of the schema then validate then validate the xml atribute against the content model definition as well as the data type.</li> </ol> Also, if this approach is taken then there would also need to be an implicit import of the xml namespace into XML Schemas similar to how the xml prefix is implicitly defined since a schema author wouldn't know if an instance were to use an XML attribute.<br /> <br /> Taking this approach for all XML attributes would solve the XInclude schema mismatch problem that Daniel pointed out but would also help deal with the fundamental issue for these xml attributes in other use cases.&nbsp; <br /> <br /> In MS System.XML.Schema validation in the Widbey RTM we will most likely at least create a switch to allow instance validation allowing xml attributes (as Daniel requested) but as I research this issue it seems more and more that this should be the default way of dealing with xml attribute validation ...<br /> <br /> <br /> <div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=358521" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashxIntroduction/Bio, the really long and boring versionhttp://blogs.msdn.com/b/daveremy/archive/2004/12/21/329086.aspx2004-12-21T19:26:00Z2004-12-21T19:26:00Z<p>Hello my name is Dave Remy (call me Remy or Rem if you want).&nbsp; I am&nbsp;a Lead Program Manager&nbsp;on Core XML Technologies at Microsoft (a part of the <a href="http://msdn.microsoft.com/xml/">Webdata XML team</a>).&nbsp;&nbsp;Currently I am focusing on&nbsp;XML Schema&nbsp;support&nbsp;as well participating on several other of the core XML type&nbsp;technologies.&nbsp;&nbsp;My main interest area these days is XML programming models and finding ways that developers can more easily use language technologies to harness the full power of XML.&nbsp; </p> <p>Prior to coming to Microsoft (Nov 2004) I was the Dev Lead for <a href="http://xmlbeans.apache.org/">XMLBeans </a>at <a href="http://www.bea.com">BEA</a>.&nbsp; XMLBeans is now an Apache open source technology that leverages XML Schema to allow you program against xml using "strong types".&nbsp; The major difference between XMLBeans and other Java/XML binding technologies was it's focus on providing a full non-lossy strongly typed programming model over an XML store rather than shredding the XML into objects.&nbsp; The goal was ease of use for a large number of XML programming scenarios but with no dead ends so that you could drop into the underlying XML store (via XmlCursor, XQuery, XPath, or DOM) if necessary.&nbsp;</p> <p>Prior to BEA I was Chief Architect and Cofounder&nbsp;of <a href="http://www.geotrust.com">GeoTrust </a>which has now become the second largest certificate authority <a href="http://www.geotrust.com/news_events/marketshare/index.htm">behind Verisign</a>.&nbsp; While at GeoTrust (overlapping into BEA as well) I coauthored the book <a href="http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=aF8uNtXAXG&amp;isbn=0672326515&amp;itm=1">Securing Web Services with WS Security</a> with <a href="http://www.computerworld.com/developmenttopics/development/webservices/story/0,10801,94909,00.html">Jothy Rosenburg </a>(Jothy was CEO of GeoTrust and later took the CTO role from me when I become Chief Architect).&nbsp; Also, while at GeoTrust I&nbsp;earned my Computer Informaton Systems Security Professional Designation (<a href="http://www.computerworld.com/developmenttopics/development/webservices/story/0,10801,94909,00.html">CISSP</a>).</p> <p>Before BEA I was CTO at <a href="http://www.computerworld.com/developmenttopics/development/webservices/story/0,10801,94909,00.html">Netstock </a>(now known for <a href="http://www.sharebuilder.com/sharebuilder/Home/QuickQA.asp">Sharebuilder</a>).&nbsp; Where we were big Visual J++ fans at the time :) At Nestock I was co-inventor the underlying Sharebuilder process which was a "dollar based investing" model rather than a "share based investing model".&nbsp; Extremely low commissions and great for the dollar cost averaging type investor.&nbsp; I understand Netstock/Sharebuilder continues to do well.</p> <p>I came to Netstock from <a href="http://www.corbis.com">Corbis</a>, the <a href="http://www.microsoft.com/billgates/bio.asp">Bill G</a> digital image company, where I was Director of Technology.&nbsp; This was a great opportunity to work with the largest digital imagery archive in the world and learn a ton about image science, cataloging and search, and much more (<a href="http://yoz.com/wired/2.11/features/corbis.html">Wired article on Corbis from back when I worked there</a>).&nbsp; I got the opportunity&nbsp;sit in meetings&nbsp;with Bill G and also to work with <a href="http://msdn.microsoft.com/blogs/ericr/">Eric Rudder </a>who was Bill's technology assistant at the time.&nbsp; Eric is now Senior VP at Microsoft and is my boss's, boss's, boss's ... boss.&nbsp; Corbis was originally formed to do Bill's house technology which was pretty amazing to witness although I was only peripherally involved.</p> <p>Prior to Corbis I was Director of Architecture at <a href="http://www.pemco.com">PEMCO</a>.&nbsp; This was&nbsp;a CIO level position running the Data Resource Management team and working strategically on how PEMCO's 4 insurance companys, bank, data processing company, and credit union's technology would grow and evolve.&nbsp; I learned a lot about the difficulty of the CIO role there.&nbsp; I also learned much about business in particular from Stan McNaughton the charismatic CEO at PEMCO.</p> <p>I ended up at PEMCO because I had been a consultant working for IBM.&nbsp; At IBM I was consulting focusing on enterprise modeling, data modeling, and in particular DB2 consulting.&nbsp; My title at IBM was Advisory Systems Engineer but my role was all about consulting.&nbsp; I had come into IBM to branch out of consulting and focus more on getting deep into DB2 technology but these were the days when IBM was just moving heavily into&nbsp;services so my background was highly valued (meaning I billed 40 hours a week, did proposals on the weekends, and whenever possible taught DB2/data modeling seminars in the evenings).&nbsp;</p> <p>Prior to going to IBM I had formed the consulting firm Relational Solutions based in Seattle (Mercer Island actually).&nbsp; Relational Solutions was doing a great business subcontracting through IBM for DB2 consulting work at companies like Boeing, Safeco, Ernst, etc.&nbsp; My partner was a great guy, David Neustadt and we had a tremendous Marketing/Recruiting Vice President named Tom Parrish.&nbsp; I thought we were poised for growth but David really wanted to stay small.&nbsp; Rather than press the issue I decided to take a significant paycut and go to IBM with the hope that I would get a chance to focus deeply on DB2 and relational technology.</p> <p>Prior to forming Relational Solutions with David Neustadt I was a software developer for Security Pacific Bank, formerly Ranier Bank, now a part Bank of America.&nbsp; Rainer bank a regional bank up in the Seattle area really had a great group of developers and I was on a rare team.&nbsp; On particular guy (Mike Hackett, who I've lost contact with) had been reading a SmallTalk book (this was in the mid 80's) and decided that we could build an object oriented Customer Relationship System based on SmallTalk principles - but built using Cobol and DB2.&nbsp; Really, it's true.&nbsp; It had full inheritance, polymorphism, message passing, etc. and fit very well with the goals of a Customer Relationship System since you had different types of&nbsp;customers that had relationships with a myriad of constantly changing products and services.&nbsp; </p> <p>Prior to Rainier Bank I was a sofware developer at Boeing which is where I got my original training as a programmer.&nbsp; Working in manufacturing was fun and a complex problem domain.&nbsp; I owe a lot to Boeing, and my friend Don Maclane who recommended me there.&nbsp; I really had practically no programming experience before starting there and Boeing gave me a lot of eduction and experience to get me started.</p> <p>Finally, prior to going to Boeing I worked for my father's company in Los Angeles called <a href="http://ftp.larry2.servegame.com/tgn.htm">The Games Network </a>which was about putting video games (actually any software) over cable television.&nbsp; We went through own mini dot com boom and bust with The Games Network going public, having lots of money on paper, tremendous presales, game contract committments, cable company endorsements, top of the world.&nbsp; We decided to engineer our own computer that would go into people's homes and, what do you know, 6 months before launch we ran out of money.&nbsp; At the same time the bottom fell out of the video games market and became&nbsp; next to impossible to raise money to get to launch.&nbsp; Then a supposed white knight came in who turned out to be a fraud and the whole thing came tumbling down.&nbsp; This was an amazing experience for me to be a part of.&nbsp; I saw the best of people and the worst (well maybe not the worst but pretty bad).&nbsp; I left Los Angeles and moved back up to Seattle deep in debt (at least for a 23 year old) but determined and much smarter.</p> <p>From an education perspective I dropped out of <a href="http://www.washington.edu/">University of WA </a>midway through my senior year (I don't think I had declared a major yet) before heading&nbsp;down to Los Angeles.&nbsp; I received an Apple II+ as a present the beginning of my senior&nbsp;year, decided I loved computers, and was learning as much as I could about them.&nbsp; I was having a difficult time breaking in to UW's Computer Science program becuase I had so many credits.&nbsp; When I got the offer to join The Games Network in LA I jumped at the chance.&nbsp; When I came back up to Seattle I started the night school route at <a href="http://www.seattleu.edu/">Seattle University </a>and after six years or so I got my undergraduate degree in Business.&nbsp; I would have rather had a computer science degree but at the time there wasn't a night school program for something like that in Seattle (that I knew of).&nbsp; Currently I am working on my Masters in Computer Science through <a href="http://www.cs.depaul.edu/news/default.asp">Depaul University </a>which has a great distance learning program.</p> <p>On the home front (Mercer Island, WA)&nbsp;I am lucky enough to have a beautiful wife, Beth, and two daughters, Lisa and Laura.&nbsp;</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=329086" width="1" height="1">daveremyhttp://blogs.msdn.com/daveremy/ProfileUrlRedirect.ashx