Bad example code is an opportunity, not a problem

lemons and lemonade

Karl Seguin has recently vented his frustration at Microsoft's example code for their new Silverlight APIs. This is nothing new. I've developed with Microsoft technologies since the days of Windows 3.1 and the one constant feature of every technology that came out of Redmond was, and apparently still is, the poor quality of the example code. I used to have the same attitude as Karl. How could Microsoft release such crap and expect developers to learn how to use their stuff well?

But then I installed Resharper and realised the genius behind Microsoft's terrible example code. I found that I quickly learnt a lot about how the example code worked by refactoring it from the tangled web of confusing names and spaghetti logic into a well-structured design with a consistent, descriptive system of names. Obviously Microsoft understood the value of scratch refactoring years before refactoring tools were even invented.

Posted on May 8, 2007 [ Permalink | Comments ]