Author Archives:

"Refactoring" Notes

I’m not going to bother with a review of Martin Fowler‘s Refactoring: Improving the Design of Existing Code. It’s good enough that its catalog, available in expanded form online, now provides the definitive vocabulary shared by dozens of refactoring tools … Continue reading 

Posted in Book Review, Refactoring | Leave a comment

Unit Testing [Serializable]

A common struggle with unit testing is figuring when to just assume somebody else’s code works. One such example is serializability: for simple classes, it should “just work” so we shouldn’t need to write a unit test for each of … Continue reading 

Posted in NUnit, Serializable, testing | 3 Comments

Review: Pragmatic Unit Testing In C# with NUnit (2nd Edition)

I’ve written hundreds of tests, read dozens of articles and listened to several presentations on unit testing, but until recently had never actually read a book dedicated to the subject. In reviewing my options, I was told repeatedly that I … Continue reading 

Posted in Book Review, NUnit, testing | Leave a comment

Lazy PowerShell Coalesce-Args

A while back I posted a coalesce function for PowerShell that would try to return the first non-null argument passed to it. One drawback of this function is that each argument expression will be evaluated before being passed into the … Continue reading 

Posted in posh-git, powershell | 1 Comment

posh-git Release v0.1

I’ve made a bit of progress on posh-git since my last post and figured now is as good a time as any to tag a v0.1 release, which you can download here. In this release… Git Branch in PowerShell Prompt … Continue reading 

Posted in git, posh-git, powershell | 3 Comments

posh-git: A PowerShell Environment for Git

I’ve been meaning to put together a post about this for a few days, but Mark Embling beat me to it. I’m a big fan of PowerShell and Git, but had never bothered using them together until Jeremy Skinner’s post … Continue reading 

Posted in git, posh-git, powershell | 2 Comments

SPWeb.AssociatedGroups.Contains Lies

While working on SPExLib (several months ago), I revisited this post, which presented a functional approach to a solution Adam describes here. Both posts include logic to add an SPWeb group association, which most simply could look something like this: … Continue reading 

Posted in Extension Methods, SharePoint, SPExLib | 2 Comments

Extension Methods on Types You Own?

It’s no secret that I’m a fan of using extension methods to make code more concise and expressive. This is particularly handy for enhancing APIs outside of your control, from the base class library to ASP.NET MVC and SharePoint. However, … Continue reading 

Posted in Uncategorized | 6 Comments

Quick Tip: Parse String to Nullable Value

When you’re dealing with a system like SharePoint that returns most data as strings, it’s common to want to parse the data back into a useful numeric format. The .NET framework offers several options to achieve this, namely the static … Continue reading 

Posted in Uncategorized | 1 Comment

Selecting Static Results with Dynamic LINQ

Dynamic LINQ (DLINQ) is a LINQ extension provided in the VS 2008 Samples. Scott Guthrie provides a good overview here: Dynamic LINQ (Part 1: Using the LINQ Dynamic Query Library), but the executive summary is that it implements certain query … Continue reading 

Posted in DLINQ, Expression Trees, LINQ, Stack Overflow | Leave a comment