<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>jaredpar's WebLog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jaredpar/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jaredpar/feed.xml</link>
    <description>Code, rants and ramblings of a programmer.</description>
    <lastBuildDate>Wed, 24 Feb 2016 14:23:00 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Blog Moving</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/blog-moving</link>
      <pubDate>Mon, 12 May 2014 14:14:08 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2014/05/12/blog-moving/</guid>
      <description><![CDATA[As you may have noticed my blog has been a little stale over the last few years. &nbsp;A large part...]]></description>
      <content:encoded><![CDATA[<p>As you may have noticed my blog has been a little stale over the last few years. &nbsp;A large part of that is simply a result in my job change 4 years ago. &nbsp;My daily developer life in Visual Studio always served as inspiration for posts: visual Studio is public, popular and relevant to many people. &nbsp;My daily developer life in a research / incubation role ... not as much. &nbsp;Lately though I've found a lot of issues that I want to write about and have decided to attempt at least to get back into a regular blogging cadence. &nbsp;</p>
<p>Though I've enjoyed having my blog on this site for some time I've decided to change it up a little and move to a different host. &nbsp;My blog will continue at the following location&nbsp;</p>
<p style="padding-left: 30px;"><a href="https://blog.paranoidcoding.com/">https://blog.paranoidcoding.com/</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Interviewing College Candidates</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/interviewing-college-candidates</link>
      <pubDate>Mon, 06 Jan 2014 06:50:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2014/01/06/interviewing-college-candidates/</guid>
      <description><![CDATA[Lately I&rsquo;ve been reading a lot about peoples interview processes and it inspired me to share...]]></description>
      <content:encoded><![CDATA[<p><span style="color: #333333; font-family: Segoe UI;">Lately I&rsquo;ve been reading a lot about peoples interview processes and it inspired me to share my process for interviewing college candidates.&nbsp; I&rsquo;ve been doing interviews at Microsoft for ~10 years now and developed this process over that time.&nbsp; </span>The format for the interviews are typically 1 hour with just me and the candidate.&nbsp; Usually in my office or occasionally a conference room.&nbsp; Unfortunately 1 hour is a very short amount of time in which to judge a candidate and I try to combat that by planning ahead and working with the below process.&nbsp;</p>
<p><span style="color: #333333; font-family: Segoe UI;">Note that this post is specifically about how I interview college candidates or candidates with a small number of years in the industry.&nbsp; I have a much different process for senior level developers (which is more of what I do these days). </span></p>
<h2>Pre Interview Setup</h2>
<p>The candidate deserves my undivided attention during the interview.&nbsp; Before I go out to greet the candidate I turn my phone off and put it in my desk, close my email, turn off the speakers to my computer and lock the screen.&nbsp; The only visible distraction I have is a clock to make sure I&rsquo;m keeping the interview moving along.&nbsp;</p>
<h2>The Introduction</h2>
<p>My very first goal in an interview is to make sure the candidate is comfortable in the environment. Interviewing is a nerve racking experience for some people (especially college candidates who are quite possibly doing this for the first time ever).&nbsp; I&rsquo;m rarely the first person on an interview loop and hence I often have to deal with candidates that are tired or perhaps rattled a bit by an interview earlier in the day.&nbsp; I find people perform best when they are in a relaxed environment and I do my best to get them there.</p>
<p>One technique I&rsquo;ve found that helps relax people is to get them talking about something they are passionate about.&nbsp; I get every candidates resume a day or two before the interview and I look over it in detail.&nbsp; I&rsquo;m looking for anything that they have put significant time or effort into: a senior project, GitHub contributions, stack overflow, etc &hellip;&nbsp;</p>
<p>Once I find that project I spend 30 minutes or so researching it myself.&nbsp; My goal is to get enough of an understanding of the project that I can have a conversation about it.&nbsp; I also write down some really easy questions about the project.&nbsp; Presenting the candidate with questions on subjects they are passionate about is a good way to get the candidate relaxed and give them an early confidence boost.&nbsp; It&rsquo;s much better then starting them off with questions I&rsquo;m passionate about</p>
<p>I usually start off with the standard small talk.&nbsp; Who I am, how long I&rsquo;ve been here and what groups I&rsquo;ve worked in at Microsoft.&nbsp; I ask them the same about themselves and then transition into the research I&rsquo;ve done on them</p>
<blockquote>
<p>I was looking over your resume and noticed your senior project on improving TCP startup.&nbsp; Tell me about that.&nbsp;</p>
</blockquote>
<p>Some people are happy to go on at length here and some are a bit more reserved.&nbsp; For the reserved I prompt them with the questions I&rsquo;ve already written down.</p>
<blockquote>
<p>Why is TCP intentionally slow at startup?</p>
<p>Your project focused on improving algorithm X, what was wrong with it?</p>
</blockquote>
<p>Remember the goal here is to relax the candidate and increase their confidence.&nbsp; Take their project, craft easy questions for it based on the work their project said they did.&nbsp; Let them shine here.&nbsp;</p>
<p>I generally reserve 10-15 minutes for this section of the interview</p>
<h2>The Technical Interview</h2>
<p>I start the technical portion off with a very easy and vaguely worded question.&nbsp; My favorite question is the following</p>
<blockquote>
<p>Write a function that takes a collection of letters and determines if there are any duplicate letters</p>
</blockquote>
<p>The candidate is free to constrain this problem however they like</p>
<blockquote>
<p>Can I use a hash table?&nbsp; Sure</p>
<p>Can I assume the letters are all ASCII? Sure</p>
<p>Can I assume they come in sorted order? Sure</p>
<p>Can I sort them? Sure</p>
<p>Can I use something like bubble sort to check every combination? Sure</p>
</blockquote>
<p>I do this for a couple of reason.&nbsp; In part I want to keep the candidate comfortable and give them an easy win on the white board.&nbsp; I don&rsquo;t care how they solve it, just that they can solve it.&nbsp; It&rsquo;s a modified fizzbuzz problem that tells me they can at least write code in the language of their choosing.&nbsp; The other reason I do this is because I&rsquo;m curious to see what questions they will ask (if they ask any).&nbsp; What they ask often reveals a good deal on how they approach coding.</p>
<p>After they get the solution correct and we walk through it I start taking things away.&nbsp;</p>
<blockquote>
<p>That hash table makes it easy doesn&rsquo;t it?&nbsp; How would you solve it without a hash table?</p>
<p>ASCII really makes the problem easy.&nbsp; How would you solve it with Unicode characters?</p>
<p>Could you solve this without allocating any memory?</p>
</blockquote>
<p>I make subtle changes to the question that make the solution <strong>incrementally</strong> harder and gauge how they react to the changes.&nbsp; I do want to stress incrementally here.&nbsp; I don&rsquo;t go from easy to hard with a single twist.&nbsp; Instead I add constraints to gradually and incrementally up the difficulty.&nbsp;</p>
<p>It&rsquo;s not critical that they solve every twist I give them.&nbsp; Really what I&rsquo;m after here is how they think about coding and whether or not they can adapt their solution to changing requirements (aka my life as a programmer).&nbsp; I&rsquo;m also curious how they react on a personal level to the changes.&nbsp; Do they get angry, excited, etc &hellip;</p>
<p>Throughout this section of the interview there is one thing I&rsquo;m constantly vigilant about</p>
<blockquote>
<p>Do <strong>not</strong> ever let the interview session go stale for more than 5-10 seconds</p>
</blockquote>
<p>There is 0 value in having an interview where me and the candidate are just staring at each other silently for several minutes.&nbsp; If they get stuck on a problem it is my job as the interviewer is to help get them unstuck.&nbsp; Ask them what they&rsquo;re stuck on, what they&rsquo;ve considered, get them to draw out sample input, anything that gets them talking or writing on the white board.</p>
<p>My time reservation for this section is 35-40 minutes but I&rsquo;m a bit more flexible.&nbsp; If the candidate is a clear hire I usually stop earlier and spend more time on selling, answering questions.&nbsp; If a candidate is struggling I give them as much time as possible to get to a good solution.&nbsp;</p>
<h2>The Wrap Up Conversation</h2>
<p>In general I let the interview wrap up be very candidate driven.&nbsp; I open the floor for questions they have.&nbsp; If they don&rsquo;t have any I try and answer the most common questions</p>
<ul>
<li>What is the environment in my group like</li>
<li>What are the ups and downs of my group</li>
<li>What is life in Seattle like</li>
<li>Why did I pick Microsoft over company X</li>
</ul>
<p>It is really important in the wrap up to make sure the candidate leaves feeling good about the interview.&nbsp; Even if the candidate completely and utterly screwed up the interview I try to make sure they leave feeling good about the session.&nbsp; They could have just had a bad day, you may have just asked them the one question they couldn&rsquo;t answer.&nbsp; It&rsquo;s very possible that you are the only &ldquo;No Hire&rdquo; they will get all day long.&nbsp; Or maybe they&rsquo;re not good enough now but a year from now they&rsquo;ve gotten enough better that they nail the interview and you end up working with them.&nbsp;</p>
<p>To sum it up in one statement &hellip;&nbsp;</p>
<blockquote>
<p>Never let a candidate leave feeling bad about themselves.&nbsp;</p>
</blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Round tripping a VSIX project</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/round-tripping-a-vsix-project</link>
      <pubDate>Wed, 04 Dec 2013 16:27:52 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2013/12/04/round-tripping-a-vsix-project/</guid>
      <description><![CDATA[Visual Studio 2012 introduced project file round tripping feature.&#160; This lets developers edit...]]></description>
      <content:encoded><![CDATA[<p>Visual Studio 2012 introduced <a href="https://blogs.msdn.com/b/visualstudio/archive/2012/03/28/round-tripping-with-visual-studio-11.aspx">project file round tripping</a> feature.&#160; This lets developers edit the same project in Visual Studio 2010, 2012 and 2013 without the need to upgrade the project file or modify it in any way.&#160; This was a highly requested feature by customers that allowed them to edit their project no matter what version of Visual Studio they had on their machine.&#160; The previous forced upgrade model for new versions was a big adoption blocker.&#160; Now customers can just grab the latest Visual Studio version and start hacking away </p>  <p>Unfortunately this feature <a href="https://blogs.msdn.com/b/zainnab/archive/2012/06/05/visual-studio-2012-compatibility-aka-project-round-tripping.aspx">does not work</a> on all project types including VSIX projects.&#160; This meant that Visual Studio Extension authors who wanted to developer extensions for all versions of Visual Studio were essentially locked into editing that code with 2010.&#160;&#160; This is doubly unfortunate given that extension authors are the type of developers most likely to early adopt new versions of Visual Studio.&#160; </p>  <p>The good news though is that it is possible to have a VSIX project be round tripped, it just requires a bit of special sauce to get working.&#160; Once done though a VSIX project can be fully edited, F5’d, etc … in any version of Visual Studio.&#160; </p>  <p>Originally this blog post was going to be a step by step process for getting a 2010 VSIX project into full round tripping mode.&#160; However as I started to write the post it was looking rather dull.&#160; Virtually every line was a variant of </p>  <ul>   <li>Open File &lt;…&gt; </li>    <li>Paste &lt;this odd snippet&gt; on line &lt;…&gt;</li> </ul>  <p>After pasting some rather ugly MsBuild XML into my post I realized that there was a much better way to convey this information: actually demonstrating the transition from a 2010 extension to a fully round trippable one on a real project.&#160; Essentially I decided the best way to do this was to speak in code.&#160; </p>  <p>Hence I created a GitHub project that starts with a simple 2010 extension and step by step (or commit by commit) turns it into a fully round trippable one.&#160; Every commit has detailed comments about why the edits were taken, what features they provide and what limitations remain. The full transition is available here </p>  <ul>   <li>GitHub Project: <a href="https://github.com/jaredpar/RoundTripVSIX">https://github.com/jaredpar/RoundTripVSIX</a></li>    <li>Commit Log: <a href="https://github.com/jaredpar/RoundTripVSIX/commits/master">https://github.com/jaredpar/RoundTripVSIX/commits/master</a></li> </ul>  <p>I hope that this speaks better to other extension developers out there and helps them get to a happy round trippable world.&#160; </p>]]></content:encoded>
    </item>
    <item>
      <title>Immutable isn’t just for parallel code</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/immutable-isnt-just-for-parallel-code</link>
      <pubDate>Tue, 02 Jul 2013 05:30:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2013/07/02/immutable-isnt-just-for-parallel-code/</guid>
      <description><![CDATA[For the last 6 months the BCL team has been hard at work shipping an out of band release of...]]></description>
      <content:encoded><![CDATA[<p>For the last 6 months the BCL team has been hard at work shipping an out of band release of immutable collections for .Net.&nbsp; Most recently delivering an efficient implementation of ImmutableArray&lt;T&gt;</p>
<blockquote>
<p><a href="https://blogs.msdn.com/b/dotnet/archive/2013/06/24/please-welcome-immutablearray.aspx">https://blogs.msdn.com/b/dotnet/archive/2013/06/24/please-welcome-immutablearray.aspx</a></p>
</blockquote>
<p>Unfortunately with every announcement around these collections I keep seeing the following going past in my twitter feed.</p>
<blockquote>
<p>That looks neat.&nbsp; Next time I&rsquo;m writing parallel code I&rsquo;m going to try that out.</p>
</blockquote>
<p>No, no no!!!&nbsp; Immutable types are not just for parallel code.&nbsp; They are very useful in even single threaded applications.&nbsp; Developers are missing out by thinking of them as a parallel only construct.&nbsp; Any time you want to enforce that the contents of a collection never change you should consider an immutable type.</p>
<p><strong>The Provider</strong></p>
<p>Consider the case of an object which provides a collection to callers where the contents never change.&nbsp; Something like Assembly.Modules.&nbsp; A type like Assembly must be robust in the face of misuse by any caller and always present the same set of Module values.&nbsp;&nbsp; Given this constraint what type should it use though for the property?&nbsp;</p>
<p>It can&rsquo;t do something as simple as using a List&lt;Module&gt; with a similarly typed backing field.&nbsp; Returning such a value would allow a devious caller to clear the list and spoil the results for everyone else.&nbsp;&nbsp; It cannot even store a List&lt;T&gt; internally and return an IEnumerable&lt;T&gt; as anyone could just come along and down cast to List&lt;T&gt; and clear the collection.&nbsp;</p>
<div style="margin-left: 10px;"><!-- code formatted by https://manoli.net/csharpformat/ -->
<pre class="csharpcode">Assembly assembly = ...;
<span class="rem">// Evil laugh</span>
((List&lt;Module&gt;)assembly.Modules).Clear(); </pre>
</div>
<p>Instead it chooses to be robust by returning a freshly allocated array on every single call to Modules [1].&nbsp; This works but is a very wasteful process and results in many unnecessary allocations.&nbsp;</p>
<p>If this API were being designed today this would be a perfect candidate for using ImmutableArray&lt;T&gt;.&nbsp; This value can be safely stored and returned with no fear of the caller deviously mutating the result.&nbsp; There is simply no way of doing so.&nbsp;</p>
<p><strong>The Consumer</strong></p>
<p>Now consider the case of the consumer who wants to store a collection of Modules instances and do multiple lazy independent calculations on them.&nbsp; In order for the different calculations to be correct they need to ensure the collection of Module instances don&rsquo;t change from operation to operation.&nbsp; Hence they have to make a decision when storing the collection in the constructor</p>
<div style="margin-left: 10px;"><!-- code formatted by https://manoli.net/csharpformat/ -->
<pre class="csharpcode"><span class="kwrd">class</span> Container {
   IEnumerable&lt;Module&gt; m_modules;

   <span class="kwrd">public</span> Container(IEnumerable&lt;Module&gt; modules) { 
     <span class="rem">// Do I trust my caller??? </span>
     m_modules = modules;
   }
}</pre>
</div>
<p>The constructor can choose to do one of the following</p>
<ol>
<li>Create a private copy of the input collection that it doesn&rsquo;t mutate</li>
<li>Create no copy and hope that the caller never mutates the input collection</li>
</ol>
<p>The first option is wasteful and the second is just a bug waiting to happen a year from now when someone decides to reuse a List&lt;Module&gt; for another purpose.&nbsp; With immutable types the container has a much better third option: demand a collection that never changes</p>
<div style="margin-left: 10px;"><!-- code formatted by https://manoli.net/csharpformat/ -->
<pre class="csharpcode"><span class="kwrd">class</span> Container {
   ImmutableArray&lt;Module&gt; m_modules;

   <span class="kwrd">public</span> Container(ImmutableArray&lt;Module&gt; modules) { 
     <span class="rem">// Trust no one </span>
     m_modules = modules;
   }
}</pre>
</div>
<p>The callee has now forcefully stated to the caller exactly what type of data it expects.&nbsp; It no longer has to make a wasteful copy or hope for good behavior.&nbsp; True this may force the caller to create an immutable copy of the value it holds.&nbsp; It&rsquo;s also just as likely that the caller will be in a position to provide the collection without any copies.&nbsp; If it takes the collection as input it can simply pass along the requirement in its parameter list.&nbsp; Or if it is the original creator of the collection it can do so as an ImmutableArray&lt;Module&gt; from the start and avoid the extra copy altogether.&nbsp; Over time, code bases which are assertive about using immutable collections will see a decrease in allocations because they will feel more comfortable with sharing data between independent components.&nbsp;</p>
<p>This is just a small sample of cases where immutable collections are useful in day to day code.&nbsp; The more you use them the more uses you will find for them.&nbsp; At some point you may even find yourself asking the following question when writing up a type</p>
<blockquote>
<p>Do I actually <strong>need</strong> to mutate this collection after I finish building it?</p>
</blockquote>
<p>Generally speaking the answer to this is no.&nbsp; And this is why you should be using immutable types.&nbsp;</p>
<p>&nbsp;</p>
<p>[1] If you dig deep into the implementation you&rsquo;ll find it&rsquo;s actually a fresh array of RuntimeModule[].&nbsp; So even though they allocate a new array on every call you can&rsquo;t safely write Module instances into it unless they happen to be instances of RuntimeModule.&nbsp; So wasteful!</p>]]></content:encoded>
    </item>
    <item>
      <title>Don’t mix await and compound assignment</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/dont-mix-await-and-compound-assignment</link>
      <pubDate>Mon, 11 Feb 2013 05:03:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2013/02/11/dont-mix-await-and-compound-assignment/</guid>
      <description><![CDATA[The 5.0 release of C# introduced the await keyword which makes it extremely easy to use...]]></description>
      <content:encoded><![CDATA[<p>The 5.0 release of C# introduced the await keyword which makes it extremely easy to use Task&lt;T&gt; in a non-blocking fashion.&#160; This allows developers to replace either blocking calls to Task.Wait() or complicated combinations of ContinueWith and callbacks with a nice simple, straight forward expression</p>  <pre class="code"><span style="background: white; color: black;">        </span><span style="background: white; color: rgb(43, 145, 175);">Task</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: blue;">int</span><span style="background: white; color: black;">&gt; task = ...;
        </span><span style="background: white; color: blue;">int </span><span style="background: white; color: black;">local = </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">task;
        Use(local);
</span></pre>

<p>What most people don’t consider is the implications of this non-blocking support.&#160; At the point the ”<span style="background: white; color: blue;">await </span><span style="background: white; color: black;">task” </span>expression executes the program can do one of two things.&#160; If task is resolved the await expression will complete and the method will continue executing immediately.&#160; If it’s not then the method will pause and some other part of the program will wake up and start running.&#160; This other code interleaves with with the execution of this method.&#160; This means subtle timing changes in when Task values are resolved can drastically alter the order in which a program executes. </p>

<p>These method interleavings can be the source of many subtle bugs in the program.&#160; They are typically timing related and hence often don’t predictably reproduce and possibly don’t show up at all until the program is executing on a customers machine.&#160; One of the most common bugs I see is when developers mistakenly combine compound assignment with the await keyword </p>

<pre class="code"><span style="background: white; color: black;">        x += </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">y;
</span></pre>

<p>The C# compiler will rewrite this code into roughly the following [1] </p>

<pre class="code"><span style="background: white; color: black;">        x = x + </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">y;
</span></pre>

<p>And it executes in the following steps</p>

<ol>
  <li>load x onto the stack </li>

  <li>await y </li>

  <li>Push result of “await y” onto the stack </li>

  <li>Add the stack values </li>

  <li>Store into x</li>
</ol>

<p>In the case where “y” isn’t resolved the execution of this code will stop at step #2.&#160; At which point some other code will begin executing in its place.&#160; If “x” is a local there isn’t much danger here but what if “x” represents a field that is accessible to another part of the program?&#160; And what if that field is modified while this expression is paused at #2?&#160; When this statement resumes it will never re-read the value of “x” and hence any writes to it which occurred during the pause will be erased once the expression completes.&#160; Or in other words, it will quite simply ignore the other write.&#160; </p>

<p>I most frequently see this problem with accumulator scenarios.&#160; A collection of tasks are spun up and the results are tallied up as they complete </p>

<pre class="code"><span style="background: white; color: black;">    </span><span style="background: white; color: blue;">class </span><span style="background: white; color: rgb(43, 145, 175);">Accumulator
    </span><span style="background: white; color: black;">{
        </span><span style="background: white; color: blue;">private int </span><span style="background: white; color: black;">m_sum;

        </span><span style="background: white; color: blue;">public int </span><span style="background: white; color: black;">Sum
        {
            </span><span style="background: white; color: blue;">get </span><span style="background: white; color: black;">{ </span><span style="background: white; color: blue;">return </span><span style="background: white; color: black;">m_sum; }
        }

        </span><span style="background: white; color: blue;">public async </span><span style="background: white; color: rgb(43, 145, 175);">Task </span><span style="background: white; color: black;">Add(</span><span style="background: white; color: rgb(43, 145, 175);">Task</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: blue;">int</span><span style="background: white; color: black;">&gt; value)
        {
            m_sum += </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">value;
        }
    }
</span></pre>

<p>This code is fundamentally incorrect because it invites this very problem.&#160; Consider the following scenario </p>

<ol>
  <li>Call to Add is made with an unresolved Task.&#160; Add pauses on the task having already read m_sum onto the stack</li>

  <li>Call to Add is made with a resolved Task with a value of 4.&#160; Add completes and m_sum is now 4 </li>

  <li>Task from step 1 resolves with a value of 2.&#160; The value on the stack for m_sum is still 0 so m_sum is written out as 2 instead of 6 </li>
</ol>

<p>&#160;</p>

<p>The way to avoid this problem is to simply not mix await and the compound operator.&#160; Instead store the await value into a temp and then do the assignment without the risk of interleavings. </p>

<p>&#160;</p>

<pre class="code"><span style="background: white; color: black;">        </span><span style="background: white; color: blue;">public async </span><span style="background: white; color: rgb(43, 145, 175);">Task </span><span style="background: white; color: black;">Add(</span><span style="background: white; color: rgb(43, 145, 175);">Task</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: blue;">int</span><span style="background: white; color: black;">&gt; value)
        {
            </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">temp = </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">value;
            m_sum += temp;
        }
</span></pre>

<p>&#160;</p>

<p>Here is a sample which will demonstrate the bug in a deterministic fashion.&#160; </p>

<pre class="code"><span style="background: white; color: black;">        </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">accumulator = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">Accumulator</span><span style="background: white; color: black;">();
        </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">taskCompletionSource1 = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">TaskCompletionSource</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: blue;">int</span><span style="background: white; color: black;">&gt;();
        </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">taskCompletionSource2 = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">TaskCompletionSource</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: blue;">int</span><span style="background: white; color: black;">&gt;();

        </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">task1 = accumulator.Add(taskCompletionSource1.Task);
        </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">task2 = accumulator.Add(taskCompletionSource2.Task);
        taskCompletionSource2.SetResult(3);
        taskCompletionSource1.SetResult(2);

        </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">task1;
        </span><span style="background: white; color: blue;">await </span><span style="background: white; color: black;">task2;

        </span><span style="background: white; color: rgb(43, 145, 175);">Console</span><span style="background: white; color: black;">.WriteLine(accumulator.Sum);
</span></pre>

<p>This code will print out 2 instead of the expected 5 </p>

<p>[1] I use “roughly” here because it the compiler actually does a more complicated rewrite.&#160; It ensures that the side effects of “x” happen exactly once during the execution of this method.&#160; For locals though this is roughly the code that is generated and serves fine for this example&#160; </p>]]></content:encoded>
    </item>
    <item>
      <title>Not all “true” are created equal</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/not-all-true-are-created-equal</link>
      <pubDate>Tue, 28 Aug 2012 05:00:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2012/08/28/not-all-true-are-created-equal/</guid>
      <description><![CDATA[&#160;  During a review of some low level bit manipulation logic a developer raised a question about...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>During a review of some low level bit manipulation logic a developer raised a question about the correctness of a piece of code which allowed any arbitrary byte to be seen as a bool.&#160; No one could recall if true was defined as not 0 or simply 1.&#160; If it was the latter then the code was allowing for a large range of invalid bool values to be created.&#160; A quick look at the CLI spec revealed the immediate answer (partition III section 1.1.2)</p>  <blockquote>   <p>A CLI Boolean type occupies 1 byte in memory. A bit pattern of all zeroes denotes a value of false. A bit pattern with any one or more bits set (analogous to a non-zero integer) denotes a value of true.</p> </blockquote>  <p>A quick test backed up this particular assertion.&#160; Any non-zero value is true and 0 is indeed false.&#160; We took the test one step further and discovered, to the surprise of about half of us, that just because two bool values are true, doesn’t mean they’re equal.&#160;&#160; </p>  <pre class="code"><span style="background: white; color: black;">    </span><span style="background: white; color: blue;">class </span><span style="background: white; color: rgb(43, 145, 175);">Program
    </span><span style="background: white; color: black;">{
        [</span><span style="background: white; color: rgb(43, 145, 175);">StructLayout</span><span style="background: white; color: black;">(</span><span style="background: white; color: rgb(43, 145, 175);">LayoutKind</span><span style="background: white; color: black;">.Explicit)]
        </span><span style="background: white; color: blue;">struct </span><span style="background: white; color: rgb(43, 145, 175);">Union
        </span><span style="background: white; color: black;">{
            [</span><span style="background: white; color: rgb(43, 145, 175);">FieldOffset</span><span style="background: white; color: black;">(0)]
            </span><span style="background: white; color: blue;">internal byte </span><span style="background: white; color: black;">ByteField;

            [</span><span style="background: white; color: rgb(43, 145, 175);">FieldOffset</span><span style="background: white; color: black;">(0)]
            </span><span style="background: white; color: blue;">internal bool </span><span style="background: white; color: black;">BoolField;
        }

        </span><span style="background: white; color: blue;">static void </span><span style="background: white; color: black;">Main(</span><span style="background: white; color: blue;">string</span><span style="background: white; color: black;">[] args)
        {
            </span><span style="background: white; color: rgb(43, 145, 175);">Union </span><span style="background: white; color: black;">u1 = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">Union</span><span style="background: white; color: black;">();
            </span><span style="background: white; color: rgb(43, 145, 175);">Union </span><span style="background: white; color: black;">u2 = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">Union</span><span style="background: white; color: black;">();
            u1.ByteField = 1;
            u2.ByteField = 2;
            </span><span style="background: white; color: rgb(43, 145, 175);">Console</span><span style="background: white; color: black;">.WriteLine(u1.BoolField); </span><span style="background: white; color: green;">// True
            </span><span style="background: white; color: rgb(43, 145, 175);">Console</span><span style="background: white; color: black;">.WriteLine(u2.BoolField); </span><span style="background: white; color: green;">// True
            </span><span style="background: white; color: rgb(43, 145, 175);">Console</span><span style="background: white; color: black;">.WriteLine(u1.BoolField == u2.BoolField); </span><span style="background: white; color: green;">// False
        </span><span style="background: white; color: black;">}
    }
</span></pre>

<p>I was one of those who was surprised <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/39/97/metablogapi/7142.wlEmoticon-smile_368A2CC6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-39-97-metablogapi/7142.wlEmoticon_2D00_smile_5F00_368A2CC6.png" /></p>]]></content:encoded>
    </item>
    <item>
      <title>Authoring a Utility Library for Visual Studio</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/authoring-a-utility-library-for-visual-studio</link>
      <pubDate>Mon, 07 May 2012 05:10:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2012/05/07/authoring-a-utility-library-for-visual-studio/</guid>
      <description><![CDATA[As I&rsquo;ve developed VsVim over the years I&rsquo;ve authored quite a few reusable Visual Studio...]]></description>
      <content:encoded><![CDATA[<p>As I&rsquo;ve developed <a href="https://github.com/jaredpar/VsVim/">VsVim</a> over the years I&rsquo;ve authored quite a few reusable Visual Studio components.&nbsp; For the last 6 months I&rsquo;ve had many of these factored out to a separate utility library and this last week I decided to publish them as a separate <a href="https://nuget.org/">NuGet</a> package.&nbsp; Even if no one else every uses the library I want to reuse the utilities in other projects I&rsquo;m working on and NuGet is the perfect distribution mechanism.&nbsp; For those interested I&rsquo;ll be blogging about these components and why I authored them in the coming weeks (hint: perf, perf and more perf).&nbsp;</p>
<p>I wanted to blog about my the rules I learned from this exercise because even as a seasoned extension author I hit a couple of very surprising problems along the way.&nbsp; Hopefully the lessons I learned will help out the next person to attempt this</p>
<h1>Utility libraries must be strongly named</h1>
<p>This is an unfortunate truth of authoring a utility library in Visual Studio.&nbsp; If you intend to ever release more than one version of a utility library then you must accept that there will be two extensions referencing different versions of your library in the same instance of Visual Studio.&nbsp; Unless the assemblies are signed the CLR will only load one version into the AppDomain.&nbsp; This means one extension will see the version it expects and the others won&rsquo;t.&nbsp; This would be disastrous if the newer version of the library had new MEF interfaces, features, etc &hellip;</p>
<p>Simply being very diligent with version numbers just isn&rsquo;t enough here.&nbsp; When comparing a DLL reference to a DLL loaded in memory the CLR will ignore version numbers on unsigned assemblies [1].&nbsp; If an app has a reference to MyUtility.dll at Version 99 and MyUtility.dll at Version 1 is loaded the CLR will consider it a match.&nbsp; There&rsquo;s nothing I&rsquo;m aware of, other than strong names, that will change this behavior.</p>
<p>This also means you can&rsquo;t even rely on the latest version of your utility library being loaded.&nbsp; Extension load order is not defined in Visual Studio [2].&nbsp;&nbsp; Hence it&rsquo;s quite possible that extension referencing the oldest version of your utility library loads first and establishes that version as the one every other extension will use.&nbsp;</p>
<p>When an assembly is strongly named the CLR will respect version numbers and load multiple versions of the assembly into the AppDomain at the same time.&nbsp; Every extension will then see the version they are expecting independent of what other extensions are installed on the machine.&nbsp;</p>
<h1>MEF isn&rsquo;t version safe by default</h1>
<p>MEF gives the appearance of being a model that deals in terms of types.&nbsp; Contracts are typically defined in terms of interfaces, [Export] of the implementation use a typeof experession and the associated [Import] is tagged on a type location.&nbsp; Everything about it screams Type, yet MEF doesn&rsquo;t actually deal in terms of types, it primarily deals in terms of strings.&nbsp; Specifically in the form of a contract name and type name.&nbsp;</p>
<p>Every export and import have a contract name and type name associated with them.&nbsp; Only when both the contract name and type name match does MEF consider an Import and Export to match.&nbsp; Consider:</p>
<pre class="code">[<span style="color: #2b91af;">Export</span>(<span style="color: blue;">typeof</span>(<span style="color: #2b91af;">IObjectCache</span>))]
<span style="color: blue;">internal sealed class </span><span style="color: #2b91af;">ObjectCache </span>: <span style="color: #2b91af;">IObjectCache </span>{

}

</pre>
<p>The above code did not create an export of the .Net type IObjectCache or even it&rsquo;s assembly qualified name.&nbsp; Instead it created an export with</p>
<ul>
<li>Contract Name: SomeNamespace.IObjectCache</li>
<li>Type Name: SomeNamespace.IObjectCache</li>
</ul>
<p>Note: If you don&rsquo;t specify a contract name explicitly MEF will just reuse the type name it generates</p>
<p>Notice that no assembly information is captured in this export.&nbsp; It&rsquo;s just a type name plus the enclosing namespace.&nbsp; This contract will match up with any other Export of a type with the same fully qualified name as IObjectCache in any assembly loaded into the AppDomain.&nbsp; And this is <strong>exactly</strong> what will happen if you have multiple versions of your library loaded into the Visual Studio process [3]</p>
<p>In order to have version same MEF components the export and import contracts need to be different for different versions of your library.&nbsp; The easiest way to achieve this is to embed the assembly version into the contract name portion of an Export and Import.&nbsp; In my projects I achieve this by means of a constant which I reuse in my AssemblyVersion attribute and Exports</p>
<pre class="code"><span style="color: blue;">public static class </span><span style="color: #2b91af;">Constants </span>{
    <span style="color: blue;">public const string </span>AssemblyVersion = <span style="color: #a31515;">"1.0.0.0"</span>;
    <span style="color: blue;">public const string </span>ContractName = <span style="color: #a31515;">"MyUtility " </span>+ AssemblyVersion;
}

[<span style="color: #2b91af;">Export</span>(<span style="color: #2b91af;">Constants</span>.ContractName, <span style="color: blue;">typeof</span>(<span style="color: #2b91af;">IObjectCache</span>))]
<span style="color: blue;">internal sealed class </span><span style="color: #2b91af;">ObjectCache </span>: <span style="color: #2b91af;">IObjectCache </span>{

}

[<span style="color: blue;">assembly</span>: AssemblyVersion(<span style="color: #2b91af;">Constants</span>.ContractName)]

</pre>
<p>Unfortunately this messiness isn&rsquo;t something that can be self contained within your library.&nbsp; It&rsquo;s a price you must push down to your consumers as well.&nbsp; Their [Import] attributes must have the same contract name else MEF won&rsquo;t consider them a match and will reject the composition.&nbsp; Hence consumers of your library must use a similar pattern.&nbsp;</p>
<pre class="code"><span style="color: blue;">public class </span><span style="color: #2b91af;">MyService </span>{
    [<span style="color: #2b91af;">ImportingConstructor</span>]
    <span style="color: blue;">public </span>MyService([<span style="color: #2b91af;">Import</span>(<span style="color: #2b91af;">Constants</span>.ContractName)] <span style="color: #2b91af;">IObjectCache </span>objectCache)
    {

    }
}

</pre>
<p>This applies to all ImportingConstructor, Import and ImportMany usage of your types.&nbsp;</p>
<p>Both of these lessons set me back quite a bit.&nbsp; But eventually I was able to produce the <a href="https://nuget.org/packages/EditorUtils">EditorUtils</a> package I&rsquo;d been working on and change <a href="https://github.com/jaredpar/VsVim/tree/nuget">VsVim</a> to use it.&nbsp; Hopefully there aren&rsquo;t many more surprises waiting for me around the corner &hellip; <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/39/97/metablogapi/1452.wlEmoticon-smile_5E33E7BC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-39-97-metablogapi/1452.wlEmoticon_2D00_smile_5F00_5E33E7BC.png" />&nbsp;</p>
<p>&nbsp;</p>
<p>[1] Except for Silverlight</p>
<p>[2] Unless there is an explicit entry in the manifest file declaring a dependency. Won&rsquo;t ever happen for unrelated extensions.</p>
<p>[3] If this surprises you then you&rsquo;re not alone. I frankly disbelieved the first person who told me this and had to create a sample app to prove it to myself</p>]]></content:encoded>
    </item>
    <item>
      <title>VsVim 1.0 Released</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/vsvim-1-0-released</link>
      <pubDate>Fri, 01 Jul 2011 05:28:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2011/07/01/vsvim-1-0-released/</guid>
      <description><![CDATA[I just released an update to VsVim for Visual Studio 2010.&#160; This is available on the extension...]]></description>
      <content:encoded><![CDATA[<p>I just released an update to VsVim for Visual Studio 2010.&#160; This is available on the extension manager in Visual Studio or can be downloaded directly at the following link.&#160; [1]</p>  <p>Link: <a href="https://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329">https://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329</a></p>  <p>GitHub: <a href="https://github.com/jaredpar/VsVim">https://github.com/jaredpar/VsVim</a></p>  <p><strong>What does 1.0 mean? </strong></p>  <p>Several people asked me what 1.0 meant for VsVim?&#160; From the first release of the project to the web I’d envisioned 1.0 as the point where I had a highly functional Vim implementation in Visual Studio.&#160;&#160; Something a Vim user could add to Visual Studio and become immediately more productive.&#160; Given the feedback I’d been receiving and seeing the trend in filed issues from major features to more minor features and bugs I felt like VsVim met that goal.&#160; </p>  <p>For me personally it’s a significant milestone in what started out as a pet project to do little more than learn F# and the new Visual Studio Editor APIs.&#160; It was only after a few months of toying around in my spare time that I thought it might end up having value to people other than myself.&#160; Even then I was just as interested in publishing a working Visual Studio 2010 editor extension for documentation purposes as I was in the actual functionality (although my primary goal quickly transitioned towards functionality).&#160; I thought it would be great if I ended up with 1000 downloads in the first year.&#160; As of this writing VsVim is at 24,000 downloads and lots of positive community feedback!&#160; It all really exciting for me.</p>  <p><strong>Release Notes</strong></p>  <p>This release is mainly a bug fix release on top of previous releases: particularly in the area of motions and synchronizing settings between Visual Studio and VsVim.&#160; </p>  <p>I do want to take a second and again thank everyone who gave me feedback or filed issues throughout the entire development cycle.&#160; It really helps to have such great feedback to work against.&#160; </p>  <p><strong>The usual caveats and expectations</strong></p>  <p>This extension is being released by me, not by Microsoft.&#160; As such the support level for this extension is equivalent to the amount of free time I have to put into it.</p>  <p>Source for this release is available on the <a href="https://github.com/jaredpar/VsVim">GitHub project site</a>.&#160; It and the associated binaries are released under the <a href="https://msdn.microsoft.com/en-us/library/cc707818.aspx">MS-PL</a>.</p>  <p>[1] The update was actually released a few weeks ago but in my excitement I forgot to blog about it.</p>]]></content:encoded>
    </item>
    <item>
      <title>DebuggerDisplay attribute best practices</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/debuggerdisplay-attribute-best-practices</link>
      <pubDate>Fri, 18 Mar 2011 05:00:00 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2011/03/18/debuggerdisplay-attribute-best-practices/</guid>
      <description><![CDATA[The DebuggerDisplayAttribute is a powerful way to customize the way values are displayed at debug...]]></description>
      <content:encoded><![CDATA[<p>The <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerdisplayattribute.aspx">DebuggerDisplayAttribute</a> is a powerful way to customize the way values are displayed at debug time.&#160; Instead of getting a simple type name display, interesting fields, properties or even custom strings can be surfaced to the user in useful combinations</p>  <pre class="code">[<span style="color: #2b91af">DebuggerDisplay</span>(<span style="color: #a31515">&quot;Student: {FirstName} {LastName}&quot;</span>)]
<span style="color: blue">public sealed class </span><span style="color: #2b91af">Student </span>{
    <span style="color: blue">public string </span>FirstName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">public string </span>LastName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
}</pre>


<p>The DebuggerDisplay attribute can customize the name, value and type columns in the debugger window.&#160; Each one can be customized using a string which can contain constant text or expressions to be be evaluated by the expression evaluator.&#160; The latter is designated by putting the expression inside {}’s (this greatly resembles String.Format)</p>

<p>This feature while very powerful and useful can also easily contribute negatively to the debugging experience when used improperly (mostly in the area of performance).&#160; After several years of working in this area and helping customers out with bugs I’ve come up with a few recommendations to help prevent this from happening [1]</p>

<h2>Don’t use multiple functions or properties in the display string</h2>

<p>Every time I see a DebuggerDisplay attribute like the following I cringe a little inside</p>

<pre class="code">[<span style="color: #2b91af">DebuggerDisplay</span>(<span style="color: #a31515">&quot;Student: {FirstName} {LastName} {Age} {Birthday} {Address}&quot;</span>)]</pre>


<p>Hands down the most expensive operation the expression evaluator does is evaluate a function.&#160; It dwarfs every other performance metric and can have a visible effect on stepping performance [2].&#160;&#160; This is true for both functions and properties (as far as the debugger is concerned there is almost no difference between the two).&#160; </p>

<p>Every one of the expression holes above results in a property being evaluated.&#160; Each property must be evaluated individually and done so once for every instance of this type in every debugger display window.&#160; This set of evaluations is repeated on every single step.&#160; This can get very expensive if collections of this type end up getting displayed (imagine stepping with a couple thousand of these in the window!).&#160; </p>

<p>Please don’t read this and remove every property from DebuggerDisplay’s in your code.&#160; One property is very unlikely to cause a problem.&#160; Issues typically arise when many properties are used and collections of that type end getting displayed in the debugger windows.&#160; </p>

<h2>Do use property / field names instead of language specific expressions</h2>

<p>Evaluation holes in the string are not limited to just properties and function calls.&#160; They can handle pretty much any legal expression you can dream up.&#160; In the past this has lead to developers putting all manner of expressions into DebuggerDisplay attributes.&#160; The most common being the use of ternary expressions</p>

<pre class="code">[<span style="color: #2b91af">DebuggerDisplay</span>(<span style="color: #a31515">&quot;Count {IsEmpty ? 0 : Count}&quot;</span>)]</pre>


<p>While this works fine, please don’t do this!&#160; DebuggerDisplay attributes are evaluated not by the language in which they were defined but by the expression evaluator of the language in which they are being used.&#160; The above works great but only when viewed in a C# application.&#160; It fails miserably when viewed in other languages like VB.Net (and when F# has their own EE it will fail for that as well).&#160; </p>

<p>While there is no truly universal expression one which is supported by most languages is member names.&#160; Having an expression which is a simple property or field goes a long way to removing this problem.&#160; </p>

<h2>Don’t evaluate expressions that throw exceptions</h2>

<p>Earlier I mentioned that the most expensive action an expression evaluator performs is evaluating a function.&#160; The most expensive variant of evaluating a function are those which throw exceptions.&#160; Please don’t do this.&#160; </p>

<h2>Don’t use mutating properties or functions</h2>

<p>Usually this goes without saying but I’ve seen enough examples of this to warrant an entry.&#160; Don’t put expressions into DebuggerDisplay values which will mutate the underlying value.&#160; This will lead to only confusion. </p>

<h2>Preferred Pattern </h2>

<p>My personal preferred pattern for DebuggerDisplay attributes is to have the entire item be an expression: DebuggerDisplay.&#160; I then add a private instance property to my type named DebuggerDisplay and do all of my custom formatting in this property.&#160; Having the property be private is fine because <a href="https://blogs.msdn.com/b/jaredpar/archive/2010/05/17/the-debugger-is-different.aspx">nothing is private in the debugger.</a></p>

<pre class="code">[<span style="color: #2b91af">DebuggerDisplay</span>(<span style="color: #a31515">&quot;{DebuggerDisplay,nq}&quot;</span>)]
<span style="color: blue">public sealed class </span><span style="color: #2b91af">Student </span>{
    <span style="color: blue">public string </span>FirstName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">public string </span>LastName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">private string </span>DebuggerDisplay {
        <span style="color: blue">get </span>{ <span style="color: blue">return string</span>.Format(<span style="color: #a31515">&quot;Student: {0} {1}&quot;</span>, FirstName, LastName); }
    }
}</pre>

<p>The “,nq” suffix here just asks the expression evaluator to remove the quotes when displaying the final value (nq = no quotes).&#160; </p>

<p>I prefer this pattern because it’s only requires a single function to be evaluated, I can still have language specific expressions (which are nicely type checked by the compiler) and it doesn’t contribute to the public API of my type.&#160; </p>

<p>[1] Note the word “I”.&#160; These are not any kind of official recommendations, just several I advocate to people using this feature. </p>

<p>[2] In one performance critical scenario for Visual Studio 2010 over 95% of it was spent evaluating the function!&#160; </p>]]></content:encoded>
    </item>
    <item>
      <title>VsVim Update Released (Version 0.9.5)</title>
      <link>https://docs.microsoft.com/archive/blogs/jaredpar/vsvim-update-released-version-0-9-5</link>
      <pubDate>Mon, 14 Mar 2011 09:06:01 GMT</pubDate>
      <dc:creator><![CDATA[JaredPar MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jaredpar/2011/03/14/vsvim-update-released-version-0-9-5/</guid>
      <description><![CDATA[I just released an update to VsVim for Visual Studio 2010.&#160; This is available on the extension...]]></description>
      <content:encoded><![CDATA[<p>I just released an update to VsVim for Visual Studio 2010.&#160; This is available on the extension manager in Visual Studio or can be downloaded directly at the following link.</p>  <p>Link: <a href="https://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329">https://visualstudiogallery.msdn.microsoft.com/en-us/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329</a></p>  <p>GitHub: <a href="https://github.com/jaredpar/VsVim">https://github.com/jaredpar/VsVim</a></p>  <p>This update includes the following</p>  <ul>   <li>Lots of undo / redo issues</li>    <li>Lots of caret positioning issues</li>    <li>Support for tabs </li>    <li>And of course many other bug fixes</li> </ul>  <p>I do want to take a second and again thank <a href="https://github.com/MartinLemburg">Martin Lemburg</a> for the many detailed issues filed during the 0.9.4 release.&#160; It really helps to have such great feedback to work against.</p>  <p>Note: The latest release is 0.9.5.1.&#160; I released a patched version of 0.9.5 to deal with bad behavior in the ‘%’ motion which was breaking a lot of users.</p>  <p><strong>Future Plans</strong></p>  <p>I’m aiming for 0.9.6 to be a quick release cycle.&#160; The main focus of this release is getting macros and visual block operators working.&#160; I already have macro support working in the beta tree.&#160; I want to spend a few weeks working out the kinks and getting through other bug fixes and then I’ll release 0.9.6.&#160; </p>  <p>Macros represent the last major feature for the 1.0.0 release.&#160; So after 0.9.6 there will maybe be 1 more bug fix release before 1.0.0! </p>  <p><strong>The usual caveats and expectations</strong></p>  <p>This extension is being released by me, not by Microsoft.&#160; As such the support level for this extension is equivalent to the amount of free time I have to put into it.</p>  <p>Source for this release is available on the <a href="https://github.com/jaredpar/VsVim">GitHub project site</a>.&#160; It and the associated binaries are released under the<a href="https://msdn.microsoft.com/en-us/library/cc707818.aspx">MS-PL</a>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>