Joining Halo Team

After spending 4 years in the C# compiler team, i have decided its time for me to try something new. A few weeks back i joined in the Halo team and have started my exciting journey there. I won’t be posting anything new about C# in the near future and the don’t know what shareable…

4

Why Can’t Extension methods on Value Type be curried

This is a followup to an post Extension Methods and Curried delegates. I have been recently asked if why Error CS1113: “Extension methods ‘Name‘ defined on value type ‘typename‘ cannot be used to create delegates” was added and what does it mean ? Here is the sort version of the story, basically the there is…

1

Debugging Dynamic objects in C# Part 1

After a long time spent working on dev 10 features and fixing the may big and small things i have finally had the time to cobble togather a post. What’s this post about ? To begin with i will be talking about debugging dynamic objects. With C# 4.0 we can instantiate and perform operations on objects …

2

C# Debugging Improvement for VS 2008 SP1- Part II

Anonymous Types On Further review there are a few problems with anonymous-types, they all boil down to the fact the names given to these types are not valid C# type names ( so that users don’t explicitly use them in code). But while debugging this is exactly the kind of thing that one wants to…

18

C# Debugging Improvements for VS 2008 SP1- Part 1

Overview Over the past few months I have been busy closing VS 2008 and working on some fixes for SP1. We have enabled some key debugging scenarios in C# in VS 2008 SP1, they include support for  Range Variables in Queries & Anonymous Types Generic Type arguments Covering all of them was making the post…

17

Debugging C# 3.0 Part II

Overview In the last article I covered the “results view” for lazy evaluated collections like Queries/Enumerable and the use of extension methods in the watch and immediate window. For completeness I will cover stepping, range variables, anonymous types and Xlinq support and this will lead us into the SP1 work for debugging. Stepping Stepping has…

3

Extension methods Interoperability between languages

Extension methods written in C# can be imported and called with Extension method semantics in VB and vice versa. This is possible since me decorate the assemblies , types and methods in the same manner. Using the Attribute [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] public sealed class ExtensionAttribute : Attribute { } This should be a special note…

4

Conversion rules for Instance parameters and their impact

Overview: Instance parameter is the first parameter of an extension method and has the “this” parameter modifier. I discuss special conversion rules for them and some of the things that users of extension methods might encounter. Consider the code bellow using System;using System.Linq;namespace TestExtensions{    class Program    {        static void Main()        {            0.Foo();    // 1            0f.Foo();           …

2

Debugging and Delayed Execution in C# 3.0

Overview: C# 3.0 added a few constructs like queries which are delay executed. This means that they are not actually executed until the results of the query are required. Debugging some of them can seem strange since one can’t step in to the Query where its created but only where its enumerated, like in a…

1

Debugging Features in C# 3.0 Part 1

Overview C# 3.0 introduces many new constructs and opens entirely new ways of thinking and developing code. In this article I will talk about the new debugging features that make it easy to see the running code and better understand it. In my experience one spends as much time writing the initial code as debugging it later….

8