Now admittedly I’ve had a glass of wine this evening, but c’mon Microsoft, I’ve read through this dialogue box thrice and I still don’t understand what you’re trying to tell me!
What Should I Click?
Tuesday, 04 August 2009 at 21:05 - Blog
Empty Catch Blocks
Thursday, 11 June 2009 at 13:33 - Blog
I’ve just found 22 examples of this anti-pattern in a small .NET project:
Oh yes, the empty catch block. Joy of joys.
Declaring an empty catch block is equivalent to professing that:
"Sometimes this code I’ve written fails. I don’t know why. I don’t really care. Please don’t tell me when it happens. I can’t hear you. La la la…"
*sigh*
If I ruled the world, empty catch blocks would be invalid in C#. Is there ever any reason for using them?
SQL 2008 - Missing Indexes Hints
Thursday, 11 June 2009 at 13:00 - Blog
Improvements to the Execution Plan UI in SQL Server Management Studio 2008 sure do make it a doddle to improve query execution time.
A client just reported that a particular stored procedure kept timing out.
Viewing the Estimated Execution Plan for this query displayed a nice green message advising of a potentially missing index which could improve performance by >95%:
Right-clicking and selecting “Missing Index Details” then brings up a new query window containing the index creation DDL (I had changed the index name by the time I grabbed this capture):
Dead easy. Repeating the process identified a second index which could further improve performance by >80%.
Of course, you still need to bear in mind other queries which access the table, and the effects on inserts/updates of creating additional indexes, but even so, this really helps the workflow.
The suggested indexes functionality was actually available in SSMS 2005 too, but the results were buried away in the XML version of the execution plan, and obscure properties windows, rather than being so in your face.
SRP Doesn’t Stand For “Several Responsibility Principle”
Monday, 08 June 2009 at 11:57 - Blog
I know it should no longer come as any surprise to me, but I just found this method (and several others like it) lurking in a Data Access Object. Grrr…
/// <summary> /// Send an email to notify that accrual data has been successfully uploaded /// </summary> /// <param name="accrualUpload"></param> /// <param name="recipientAddresses"></param> public void SendSuccessfulUploadEmail(AccrualUpload accrualUpload, Collection<MailAddress> recipientAddresses)
Much of software design / architecture isn't technically difficult, it just requires a little thought - "where does this functionality belong?" - rather than forcing code into the first class you come across.
Did I mention how useful NDepend is in exposing idiocy like this? I think I did. And I really should get round to blogging about how handy CodeRush and Refactor Pro are for cleaning up such smells.
.NET - Retrieving the Month Name
Monday, 08 June 2009 at 11:18 - Blog
Here’s another amusing method I recently found in some production code which comes straight from the “can’t be bothered to learn the framework (or how to Google)” style of programming:
/// <summary>
/// Converts a month number into the name
/// </summary>
/// <param name="monthNumber"></param>
private string GetMonthName(int monthNumber)
{
return String.Format("{0:MMMM}", new DateTime(1969, monthNumber, 1));
}
I wonder what the significance of 1969 is? Year of the author's birth, perhaps?!
Aside from being hacky, there is a performance implication to unnecessarily creating new DateTime objects and performing string formatting in this way. In my tests, I’ve found that this method is around 18 times slower than simply calling System.Globalization.DateTimeFormatInfo.CurrentInfo.GetMonthName(monthNumber).
Ian Nullson
Saturday, 06 June 2009 at 18:01 - Blog
Oh dear. Royal Mail have been taking tips from Creative:

Agile Yorkshire @ The Pub – Gojko Adzic, 10th June
Friday, 05 June 2009 at 09:26 - Blog
If you’re in the Leeds area next Wednesday, why not come along to this Agile Yorkshire session?
10th June - Gojko Adzic: Slim, The Future Of FitNesse
Details
This talk will introduce Slim, the most important upgrade to FitNesse in years. Slim is the new test runner which promises to bring platform interoperability, easier integration, a much simpler programming model and lots of small helpers that will allow us to write and maintain executable specifications and acceptance tests easier. This is a session for .NET and Java developers. Some prior exposure to FitNesse and FIT would be beneficial, but not required.
Speaker
Gojko Adzic is a software craftsman with a passion for new technologies, programming and writing. He runs Neuri Ltd, a UK-based consultancy that helps companies build better software by introducing agile practices and tools and improving communication between software teams, stakeholders and clients. See http://gojko.net/about/ for more details.
Venue: Victoria Hotel, Central Leeds
Date/Time: Wednesday, 10th June, 6:30pm sharp.
More details: http://www.agileyorkshire.org/
Referral Questions
Friday, 29 May 2009 at 08:00 - Blog
I love looking through the Traffic Sources section of my Google Analytics reports to discover how people found my site.
To the end of 2008, over 75% of visits had come via search engines. There are thousands of weird keywords and phrases by which people have somehow managed to stumble across my little home on the web, but the ones that entertain me most are when people type entire questions into a search engine.
I thought it would be a nice idea to share some of these questions posed by previous visitors to ianfnelson.com, and perhaps attempt to provide answers where possible. I’m helpful like that. Here goes:
Can You Tell Me The Dates and Names Of The Monarchs From 1066?
No. But Wikipedia can.
Can You Get Married At York Minster?
I believe it’s possible, if you have some kind of special relationship with the place.
Does Ian Nelson Have Cars?
He does.
Do I Have To Tell My Boss That I Have NF?
As in the flesh-eating virus?! It might be a nice idea.
Does Grecian 2000 Actually Work?
How should I know? Cheeky bugger.
Does My Japanese Wife Need to Take The “Life In The UK” Test?
If she wants to settle in the UK, yes.
How Are They Consumed?
They’re gulped down quickly.
How Much Do Avanade Pay?
Not enough.
How Much Is A Pint In Riga?
Last time I was there, about £1 (€1.11, $1.51).
How Much Is A Shag In Riga?
Er, I didn’t find out.
How Old Is Ian Nelson?
33.
How To Annoy A Four Year Old?
Insist that they’re only three?
How To Avoid Jury Service?
Serve a prison sentence, or develop a mental health problem.
How To Get Married In Newcastle Upon Tyne?
Carefully.
How To Improve Performance In NHibernate?
Buy and use NHProf.
How To Peel a Banana?
I do it this way.
How To Peel a Banana Strangely?
Er, with your feet?
How To Seem Genuinely Appreciative At A Bridal Shower?
Ha ha! How about considering how lucky you are that friends and/or family care about you enough to throw such an event, and shower you and your child with gifts?
Is Ian Nelson Gay?
No.
Is Ian Nelson Married?
Yes.
Is Ian Nelson Weird?
Slightly.
Was This Information Helpful?
Not so much.
What Day Of The Week Was 25 September 1998?
Friday. I had quite a thirst going that day.
What Do Schoolteachers and Sumo Wrestlers Have In Common?
Find out by reading Freakonomics.
What Does “Ey Oop” Mean?
“Hello”.
What Is “Heather” In Gaelic?
“Fraoch”.
What Is Jury Service Like?
See my blog post on the experience.
What Is Santa Claus Postcode?
In the UK, SAN TA1. In Canada, HOH OHO.
What Is The Easiest Munro To Climb?
Probably Carn Aosda. Dull as dishwater, though.
What Is The Role Of Ian Nelson?
I wish I knew.
What Nation Gave The World The Beatles?
They hailed from Liverpool, England.
What Time Do You Make It?
Five past Three.
Where Did Telnet Go?
It’s not installed by default in Vista. Here’s how to add it.
Who Sang “We Close Our Eyes”?
Go West.
Who Sings “Bruised But Not Broken”?
Joss Stone.
This was a public service from ianfnelson.com :-)
Ian Nelson, MCPD
Wednesday, 27 May 2009 at 12:24 - Blog
Well, for the record, I passed MS exam 70-553 yesterday on my second attempt, which makes me a Microsoft Certified Professional Developer – Enterprise Application Developer:
And I also acquired a few new MCTS certifications as a happy by-product:
My full transcript, including “legacy” certifications, is here.
Phew! I think that the time has now come for me to take a bit of a break from the certification circus. They are a nice-to-have, but the opportunity cost is too high – there are many other ways in which I can spend what little spare time I have to better develop my skills.
New Office Photos
Friday, 22 May 2009 at 08:00 - Blog
I promised you some photos of my new office a while back, didn’t I?
OK, here you go. Click for larger versions.






