December 27, 2009 18:40
class One
{
private static string me = "Am I different?";
}
class Two
{
private static string me;
static Two() { me = "Am I different?"; }
}
There's a certain confusion around static constructors. Why should we use them instead of static initializers? Any difference between the two samples above?
The rule of thumb is simple. If you want to control the time when CLR would initialize static fields, add the static constructor. If you don't care - skip it and use static initializers.
More...
December 18, 2009 10:08
Update: Not actual anymore. Thanks to all interested.
My contract with the current employer prematurely ends in January 2010, so I've started looking for the next big thing.
If your company is in EU and needs a .NET expert passionate about agile development - please drop me a line at andrew[AT]codevanced[DOT]net to get the CV and discuss the opportunities.
Interestingly enough, quite a few of my colleagues also have their contracts finished in January. So if you're looking for hiring a team of highly skilled professionals, I'd be more than happy to discuss that as well.
November 29, 2009 19:58
Doesn't it look like Christmas has already started? Recently I had the pleasure of being contacted by Santa Claus Patrick Smacchia, lead developer of NDepend, who offered me a free Pro license.
(In case you don't know: NDepend is an awesome static code analysis tool to measure quality of .NET apps in a bunch of ways, including code metrics and bewilderingly abstruse, yet amazing, visualization approach.)
Woo-hoo! I remember playing with a trial version last year, which was kind of nice, but a free Pro is a free Pro. The offer didn't require a blog post in return, but very soon I realized that I cannot but post... because I'd picked up Resharper as a guinea pig.
More...
October 25, 2009 23:08
November is going to be busy this year.
On November 7 I'll be talking about Distributed Agile Development at ESWC in Berlin. Tried to make it both hilarious and insightful - we'll see if it would pan out. At least the slides are drawn by hand.
And on November 11, just 4 days later, I'm doing an overview of mocking frameworks at Microsoft here in Prague - mostly a coding session highlighting the differences between Isolator, Moq, NMock2, Rhino Mocks and Pex.
More...
October 18, 2009 17:25
A few days ago my workmate Ian made a point that there should be a nice way to implement type safe route registration in ASP.NET MVC.
Type safe! Can anyone read these words without experiencing a tug of excitement, without being swayed by the view of departed bugs and newly arrived refactorings on controllers and actions - refactorings that don't break your app?
Indeed, type safe is possible. Here's how we register our routes now:
routes.MapRoute(
"viewProduct",
"{locale}/{product}/view/{mode}/",
new { controller = "Product", action = "Display", mode = "full" }
);
and here's a type safe way:
routes.MapRoute(
"{locale}/{product}/view/{mode}/")
.On<ProductController>(x => x.Display("full"));
More...
October 4, 2009 22:14
About 9 months ago I posted a comparison of different mocking frameworks. A lot has changed since then - armloads of bugfixes, gratifying influx of new features, and even a new mocking framework (!) - so time is ripe for a new comparison.
But before I move on, here's a very brief list of changes.
More...