About jaredpar's WebLog

I'm a developer on a Microsoft incubation project working on programing languages and parallel computing. Previously I spent 4 years on the Visual Studio Languages team in the Compiler, Debugger and IDE spaces. This blog is my way of sharing my experiences coding and scripting in a variety of languages (F#, C#, C++, VB.Net, ...) and environments. You can also follow me on twitter: @jaredpar

Many developers want to implement equality functions for their objects. DotNet made equality a deep part of the framework and added support all the way up to System.Object with Equals and GetHashCode . In addition to the strongly enforced...

I am a huge fan of read only/immutable collections and data. Hopefully the increased exposure through the blogosphere alerted users to the advantages of this type of programming for the appropriate scenarios. I wanted to discuss ReadOnlyCollection<T>...

Thread local storage is another method of synchronization between threads. It is different that most synchronization cases because instead of sharing state between threads it enables developers to have independent, thread specific pieces of data which...

Both VB and C# have a feature of generic overload resolution that is fairly helpful and yet a source of gotchas. Lets say you have two methods with the same number of arguments. One method has arguments with generic types and the other does not. For Example...

Previously we discussed the opposite problem. This is a lesser but often more frustrating problem because there is no, AFAIK, built in solution for the BCL. However it's problem that can be solved once and reused with a generic solution. IComparable<T>...

Really this guideline is a bit longer but putting it all in a blog title seemed a bit too much. The full guideline should read: "If a generic class constructor arguments contain types of all generic parameters, provide a static method named...

Reference values are a powerful feature of C++ but I find they have one significant detractor. A developer can not look at an API call and determine if a parameter is being passed by reference or value (VB has the same problem). IMHO this is one item...

Recently we had a good discussion on an internal alias about the use of Me, MyClass and MyBase in VB. Me, MyBase and MyClass are all ways to access instance member data in a VB class or structure. There was a little bit of confusion on the actual workings...

While investigating a crash during a suite run I found the stack walk included the destructor for a CComAutoCriticalSection . This is a fairly reliable class so I immediately suspected my code. I did a couple of quick checks for a double free and didn...

IComparable(Of T) is an interface saying "I can compare myself to other objects of the same type". And IComparer(Of T) is an interface saying "I can compare two objects of this type.". Often API's which need to perform...

Today what started out as a crash due to a pure virtual call turned into finding a gotcha in CComPtrBase<T>. Essentially the code in question boiled down to the following. Can you spot the problem? void GetAStudent(CComPtrBase<T> &spStudent...

Previously I discussed a potential missing API in List(Of T).BinaryInsert. One of the items I mentioned was it had better performance because it was O(Log N) vs Insert and Sort which is O(NLogN). Several users correctly pointed out this was incorrect...

Been far too long since I blogged about a new PowerShell script. This is not to say I've stopped using PowerShell, more that I've been too busy playing with other tools to spend a significant amount of time updating my scripts. This is a simple, yet straight...

I've had a couple people ask me this question about my blog. The simple answer is: to explore my adventures in code, coding, patterns and pretty much anything else related to programming. I realize from a readers perspective my topics may...

I often post code examples, samples and snippets on this blog. Many of these samples are a part of a utility library I've been writing and maintaining for many years now. Essentially since I got involved in DotNet programming.
I write a lot of code...

In an effort to post more often and with greater effect, I've been trying to divide my posts into short, targeted posts and longer in depth posts. Thus far my short posts aren't nearly as short as I'd like them to be and end up being much closer to my...