New MSIL & Subset CodeDom Provider samples [Peter Drayton]

There’s a fair bit written about using CodeDom, but samples showing how to implement your own provider have been quite thin on the ground. Fortunately Eden Li, a CLR intern this summer, produced a couple of useful CodeDom provider samples now live on the MSDN BCL site: MSIL provider: consumes 1.1-level CodeDom trees and generates…

2

Issues with Console APIs when stdout is redirected to a file [Ravi Krishnaswamy]

When you redirect stdout of your consoleapp to a file, you can expect that a number of Console APIs won’t work quite right. For ex, MoveBufferArea is an obvious candidate of something that can’t be supported. In this situation you will get an IOException saying that the handle is invalid or something like that. We…

5

Amusing thoughts before the holidays [Kit George]

We happened to discuss the new naming guideline for generics today, and for whatever reason, or discussion turned to some of the more interesting, and amusing names that could be designed around the decision to use a named generic argument, preceeded by the letter T (example: Dictionary<TKey, TValue>. Ideas centered around two general themes: making…

2

Some updated FAQs available on our website

Anthony Moore has updated the Numeric Types FAQ, and the Date and Time FAQ on our webiste. Check out the new FAQs at http://msdn.microsoft.com/netframework/programming/bcl/FAQ/. Note also that if you’d like to see questions answered in these FAQs, just send us your questions at bclpub@microsoft.com.

0

.NET Arrays, IList<T>, Generic Algorithms, and what about STL? [Brian Grunkemeyer]

When we were designing our generic collections classes, one of the things that bothered me was how to write a generic algorithm that would work on both arrays and collections.  To drive generic programming, of course we must make arrays and generic collections as seamless as possible.  It felt that there should be a simple…

4

Array.IndexOf performance caveat[Gang Peng]

Array.IndexOf are “generic” methods to search for an item in an one dimensional array. However since they are generic, there are some performance caveats.   Array.IndexOf handles arrays in three different ways: (1)    If the array is a SZArray (one dimensional array with zero-based indexing) and element type is one of following types: Byte, SByte, Boolean, Int16,…

1

Path.GetDirectoryName [Ravi Krishnaswamy]

Clarifying the behavior of Path.GetDirectoryName.   This is a convenient string parsing method to get the directory path of a file path. It validates neither the given file path nor the returned directory path. This method merely removes the last element of the given file path, i.e. it returns a string consisting of all characters…

2

Regular Expression performance [David Gutierrez]

I often get questions about Regex and what the RegexOptions.Compiled flag actually does. There are in fact three different modes that Regex can work in: interpreted (without the compiled flag), compiled on the fly (with the compiled flag), and precompiled.  Each of these modes has its own trade offs in performance – I’m mainly talking about startup…

7

Ye’ old BCL Dev discusses our classes on .NET Rocks [Kit George]

Jay Roxe used to work on the BCL team as the dev lead, and has a lot of excellent historical knowledge about fundamental classes. He recently gave an interview on .NET Rocks, in which he discusses a wide variety of things, including touching on the internals of String and StringBuilder. Check it out!

2