10/12/07

I joined the Microsoft C# team

A couple of weeks ago I moved from Germany to Redmond, WA to join the C# IDE team. I have become an SDET (test developer) on the IDE QA. Areas we own are the editor, syntax highlighting, IntelliSense, refactoring, Edit and Continue, Class View, Solution Explorer, etc. We do not cover any designers (such as the WinForms designer) and parts of the IDE not related to the C# language.

As you might have noticed from the contents of this blog, C# team is probably the most interesting place within Microsoft for me to work at. After my first week, I have to say that I'm really happy to be here and to meet amazingly smart and passionate people working on the stuff I'm most interested in.

I hope to continue blogging and to improve the quality of my postings, to keep up with the rest of my new team. If you're interested in that, I'll give a couple of links into our teams blogosphere. Using transitive closure, you can find the remaining C# blogs by following links from there.
  • Charlie Calvert is the community PM of the C# team and his blog is always an interesting resource to watch, because it accumulates other resources and is a recommended entry point to the C# blogosphere and community.
  • Rusty Miller is the C# test manager and has a couple of great posts about how we test C#. That way I could learn something about our team before coming here.
  • Gabriel Esparza-Romero is my manager and a great person to work with. He hasn't posted recently but I will still keep an eye on his blog :)
  • Eric Maino is also an SDET on our team and he helps me getting up to speed and ramping up.
  • CSharpening is a new blog of the C# QA team.
  • C# bloggers is the MSDN list of the bloggers on our team, unfortunately very far from being a complete list. I'll see who I have to bug here to have this list updated.
  • You will find links to many more great blogs from our team and from outside - in the rightmost column of my own blog. I highly recommend all of them, plus any other blogs I might have missed and still have to discover.
Oh, and feel free to contact me with any questions or feedback, I'd be happy to do my best to answer.

Thanks!
Kirill

10/5/07

yield foreach

A while ago I submitted a suggestion to MS Connect: yield return to also yield collections. yield foreach could be a way to yield return items one by one without explicitly writing yield return in a foreach loop. This would basically be a way to flatten nested iterators like does. On the feedback page I also give an example, where this might be useful.

It turns out, the C# team has already been thinking about adding this feature in some future version (post-Orcas). Wes Dyer from the C# Compiler Team has an excellent post about this feature here.

An interesting question is: why is the foreach keyword there? Wouldn't it be sufficient to just write yield return MyCollection; and that's it? The compiler would be able to figure out if the thing implements IEnumerable, right? Well, consider what happens if the return type of the main (outer) iterator is IEnumerable<IEnumerable>? In this case the compiler wouldn't know what to do - just return the collection as if it would be an item or flatten the collection? yield foreach is a way to explicitly tell the compiler: yes, I'm sure, please emit the foreach loop for me.
Another advantage is that no new keyword has to be introduced - both yield and foreach are already reserved keywords.

For those interested, Wes links to a research paper about iterators: Iterators revisited: proof rules and implementation