Monthly Archive for: ‘May, 2009’

Referral Questions

2

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

0

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:

Microsoft Certified Professional Developer

And I also acquired a few new MCTS certifications as a happy by-product:

Microsoft Certfiied Technology Specialist

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

9

I promised you some photos of my new office a while back, didn’t I?

OK, here you go. Click for larger versions.

The Desk

The Desk

‘Puter

'Puter

One Of These Books Is Not Like The Others

One Of These Books Is Not Like The Others

Bits n Bobs

Bits n Bobs

In Gnasher We Trust

In Gnasher We Trust

Typemock Bundle Launches

0

The folks at Typemock have come up with a cunning viral way to market a new software bundle comprising of their renowned Typemock Isolator and Ivonna tools. Having mentioned Typemock in this blog previously, and being something of a unit testing zealot, I’m happy to be a pawn in their campaign!

Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.

Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle – and for the launch will be giving out FREE licenses to bloggers and their readers.

The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.

Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePoint, ASP.NET, MVC, WCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.

The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you’ll get a license automatically (even if more than 60 submit) during the first week of this announcement.

Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.

Go ahead, click the following link for more information on how to get your free license.

NHProf

0

The inimitable Ayende Rahien is close to releasing version 1.0 of his NHibernate Profiler tool, and it really is shaping up to be a rather lovely little addition to my developer toolbox.

In much the same way that we can use SQL Server Profiler to monitor database activity, and ANTS Profiler to monitor the performance and memory usage of .NET applications, NHProf profiles the activity of the data access layer (NHibernate), and even goes as far as providing helpful hints for potential improvements.

NHibernate is powerful object relational mapper, but has a (perhaps deserved) reputation for having a steep learning curve. One of its major benefits is that it abstracts away much of the drudgery of writing data access code from the developer, but as an unfortunate side effect of this it can make it easy to create inefficient data access layers.

NHProf aims to reduce this risk by providing:

“Cognitive application awareness.

Visual insight into the interaction between your database and application code.

Analysis and detection of common pitfalls when using NHibernate.”

Sounds good, doesn’t it? So what does that mean in practice?

Here’s a screenshot of the release candidate. Note that the Session Factory Statistics functionality is disabled in the current build.

NHibernate Profiler

Each profiled NHibernate session can be selected individually from the pane in the top left, and from there we can drill down to see the details of each SQL statement executed against the database (formatted in nice readable manner), along with details of any parameters, and even an option of viewing the rows resulting from the statement.

The statements are interpreted, and suggestions and warnings are flagged as alerts, along with hyperlinks to online guidance explaining how the data access can be improved.

NHibernate Profiler

A stack trace is also provided for each statement, allowing us to identify the code that caused the data access to occur. It’s possible to double-click on a row within this trace to jump straight to the code in Visual Studio.

NHibernate Profiler

In addition to showing the SQL statements executed by each session, details of the entities loaded by each session are also given.

NHibernate Profiler

…and there’s a summary of the NHibernate usage for each session.

NHibernate Profiler

As well as providing session-by-session detail of what’s happening, NHProf allows us to analyse the overall activity. Here, I’m looking at unique queries containing the string “study” (note that differing parameters don’t count towards “uniqueness”):

NHibernate Profiler

We can also obtain analysis by Method, Url (for web applications) and Overall Usage statistics:

NHibernate Profiler

In my opinion NHProf has the potential to become an essential tool when creating or maintaining a solution which leverages the power of NHibernate. In addition to highlighting performance and other issues, it is a great aid when learning about NHibernate, or when familiarising oneself with an inherited solution. Overall, it’s the next best thing to having Ayende sat by your side lending a guiding hand.

TFS: Using Alternative Diff/Merge Tools

1

There are many things I love about Team Foundation Server, but the supplied diff/merge tool is not one of them. It is – how can I put this? – somewhat basic. Indeed, I’ve heard tell of people going out of their way to avoid merges purely because they find the process so clunky.

Here’s the good news – you can easily configure TFS to use a different, third-party, diff/merge tool, perhaps the one you’ve grown to know and love over many years of happy software development using other SCM products. Maybe you like WinMerge, or love TortoiseMerge. Perhaps you’re like my friend John and swear by SourceGear DiffMerge. Or maybe, like me, you’re a Beyond Compare fanboy. No problem, they can all be used by TFS. Here’s how:

  • Open up the Visual Studio options (Tools –> Options).
  • Expand the Source Control –> Visual Studio Team Foundation Server section.
  • Click the Configure User Tools… button:

dm1

  • Click the Add… button to set up a new file extension operation:

dm2

  • Set up a Compare operation to run against all files (extension of *):

dm3

  • Repeat the process to add a Merge operation to run against all file extensions.

At this point, you’re probably thinking “wooah, what do those argument parameters mean? How do I know what to enter?”. MSDN won’t help you out (“type any arguments that your tool requires” – thanks for that!).

Fortunately James Manning has posted a blog article which not only explains what the argument parameters mean, but also suggests recommended parameters for various popular tools, including those mentioned at the beginning of this post. Thanks, James! 

Voila! OK your way back out of the dialog boxes, and your Compares and Merges will now be displayed using your favourite Diff/Merge tool. Feel your productivity and confidence soar!

Tool Time

3

The readership of this blog is generally split between a minority of visitors who know me in “real life” (hello, mother!), and a majority who have an interest in .NET, SQL Server, and associated software development topics. There is of course, some significant overlap between the two groups (I hope you’re remembering this – I’ll be asking for a Venn diagram later!)

Anecdotal evidence reveals that some of the techies amongst you appreciate it when I blog about the tools, components, services and techniques which I regularly use in my day to day work. So, I shall try to include more of that kind of content in the future.

In the meantime, you might like to check out http://ianfnelson.com/pc-build/ , where I keep a crib sheet listing the software currently installed on my laptop. This is ostensibly to assist me with any rebuilds, but I will enhance it to include links to the application websites and any reviews I might have written on this blog.

I hope you find this useful.

Questioning the Software Development Process

0

If you’ve taken a look at the homepage for my business site, you’ll know that there are three areas of expertise that really interest me:

  1. Enterprise .NET Development
    Architecture, Design and Development of enterprise n-tier .NET solutions using a domain-driven, object-oriented approach.
  2. SQL Server Development
    All aspects of development with the full range of the SQL Server suite, including Analysis Services, Integration Services and Reporting Services.
  3. Software Development Process Improvement
    Proven experience implementing version control, work item tracking and continuous integration.

The last point is fairly woolly and difficult to convey in a single bullet point. What I’m trying to get across is that, having spent a decade or so developing solutions for a wide variety of organisations and industries, I have had the benefit of witnessing many working practices and techniques and obtained a reasonable idea of what does and doesn’t make for an efficient and productive software development team.

Further, I believe that this experience of “other places” is an example of the added value that comes from hiring a freelancer or consultancy for a piece of work. So, whilst clients will generally initially hire me to undertake a particular chunk of .NET/SQL development work, inevitably as I go about that task I will bring to the table some of the best practices that I’ve encountered over the years.

Often these issues will be raised early in an engagement, when asking seemingly basic and straighforward questions of the client in order to get on with the job in hand:

  • Which source control system are we using?
  • Where do I log bugs?
  • Which unit testing framework are we using?

As time progresses, and depending on the nature of the client, the questions have a tendency to get increasingly specific, and perhaps be re-phrased as open suggestions:

  • Will the deployment occur out of hours?
  • Should we be performing static analysis as part of the build process? FxCop, NDepend perhaps?
  • Wouldn’t it be a good idea to use a mocking framework like Rhino Mocks or MOQ to simplify these tests?
  • I really think that the database schema should be version controlled.

Some clients are more receptive to these ideas than others, and inevitably there’s a You Don't Wanna Do It Like That! delicate balance to be struck between being seen as the helpful and experienced consultant who’s full of good ideas, and the irritating Mr “You Don’t Wanna Do It Like That” character portrayed by Harry Enfield. And the willingness of an organisation to change will fall somewhere on the continuum between “let’s change everything again starting today” and “but that’s the way we’ve always done it!”

Still, it occurs to me that there is a definite value in asking these questions when it seems appropriate. Further, I find that some of them work excellently in job interview situations to turn the interview into more of a dialogue (letting the interviewer see that you’re interested and thoughtful), or at the very least as fodder for the inevitable “Do you have any questions for me?” coda.

So, with that in mind, I’ve decided to compile and publish a list of the questions I like to ask (if only to myself!) about the way in which development teams work.

You’ll find it at http://ianfnelson.com/software-development-process-questions

Feel free to add comments and suggestions to that page, and I’ll try to keep the list updated over time.

What Value a Conference?

1

Tuesday of this week was a good day for conference announcements.

First, Ben Hall announced the next Alt.Net.UK conference, to be held in London over the course of a full summer weekend. This includes an Alt.Net beers session on the Friday night, one of Alan Dean’s much talked-about Open Space Coding days on the Saturday, and finally an AltNetConf Open Space discussion on the Sunday. The value to any prospective attendee would appear to be sizable, yet the cost? As with all Alt.Net.UK events, it’s free.

Later that day, when our American cousins awoke, Jeff and Joel announced a series of five Stack Overflow DevDays, to be held in four US cities and London, UK. Deliberately priced reasonably at just $99/£85, the places have filled up fast – the cost seems to be low enough to pose no barrier for most of those interested in attending, even in these harsh economic times.

This caused one of the Alt.NET UK organisers, Alan Dean, to tweet the following hypothetical question:

“We intend to keep http://www.altnetuk.com / free (we like it that way) but I’m curious: if it were a paid event, how much do people think that tickets would cost?

It’s a tricky question, especially in the current economic climate, and there’s definitely a difference between “tickets would cost” and “people would be willing to pay”. But having given it some thought, I tweeted this reply:

@adean alt.net pricing – for the recent In The North event, perhaps £195? For full weekend, incl. codeday, more like £495. But free is good!

And here’s my thinking: looking at pricing for the big name conferences such as Tech-Ed, DevWeek, DevTeach, Mix, or Software Architect, you can expect to pay thousands of euros, dollars or pounds. Plus, they’re always held on weekdays, which further increases the effective cost for freelancers such as myself.

From a technical learning perspective, one of the most useful paid conferences I ever attended was Software Architect 2007 (see this blog post). The speakers were generally excellent, and really helped me get to grips with concepts including Contract First Development, Loose Coupling and Inversion of Control, which have all since been staples of the solutions I’ve developed. But as I mentioned at the time, the attitudes of some of the other attendees surprised me:

“It amazed me that a number of my fellow delegates kept raising their hands and asking questions which invariably began "Yeah, but why can’t I just…", followed by suggestions which effectively seemed to boil down to creating hardcoded, inflexible solutions! To say that this was supposedly a conference of architects, even relatively simple concepts such as Reflection, Polymorphism and Generics seemed to be lost on some people, who apparently would be more comfortable maintaining massive switch statements for the rest of eternity!”

Although there is some overlap in delegates, there’s a notable difference in the attendee demographic between the big paid conferences and the shoestring community affairs. Generally speaking, many of the attendees at the former tend to have their costs covered by their employers, and perhaps see such events as being a cunning way to get an easy day out of the office. By contrast, those people who give up their weekends and pay their own way to participate in community events are invariably passionate about technology and best practices. As a result, these tend to be the better way to network, socialise, learn, share experiences, and generally meet like-minded individuals (as opposed to suffering death by PowerPoint), and how do you put a price on that?

I consider that, for the right attendees, the OpenConf Alt.NET events offer the same value as these big-budget conferences, but without the associated glamour, high-profile speakers, swag, and other overheads.

So, with a finger waving wildly in the air, I thought that a figure of £495, being approximately half the cost of a typical three-day conference, sounded reasonable. But then an afterthought struck me, and I followed up on my original tweet with:

@adean …although having said that, any charge would change the attending demographic, probably negatively so, and hence reduce the value!

Gah, it’s a paradox! The intrinsic value of the OpenConf format is that it attracts the passionate folk who turn up, unfunded by their employers, out of their love for tech. Start charging an appropriate sum, and the demographic will change, reducing the value of the conference accordingly.

Fortunately, the Alt.Net.UK organisers have no plans to start charging, so this can remain merely a curious hypothetical discussion!

What do you think? Which events, paid or community-driven, do you consider to be most useful to your career and personal development?

appSettings Considered Harmful

0

Since .NET 1.0, developers have been able to easily dump all manner of settings in the appSettings configuration section. And boy, does it get overused! Ever join a new project and find something like this lurking in the config file?

<appSettings>
<add key="SmtpServer" value="smtp.mycompany.com" />
<add key="bgColor" value="lightsteelblue" />
<!-- <add key="connstr" value="Server=TestDB;initial catalog=DBName;Integrated Security=SSPI" /> -->
<add key="connstr" value="Server=LiveDB;initial catalog=DBName;Integrated Security=SSPI" />
<add key="PageSize" value="20" />
<add key="Homepage" value="/default.aspx" />
<add key="FooServiceLicenseKey" value="YR39-WN51-CB73-DF62" />
<add key="SendEmails" value="True" />
<add key="FontName" value="Arial" />
<add key="CookieName" value="Foo" />
<add key="AdminTabVisible" value="False" />
<add key="BetaTabVisible" value="False" />
<add key="NotesTabVisible" value="False" />
<add key="IntranetURL" value="http://intranet.mycompany.com" />
<add key="DummyCustomerID" value="99" />
<add key="TimeoutPeriod" value="150" />
<add key="ShowErrors" value="2" />
<add key="PostcodeRegEx" value="^([Gg]
[Ii]
[Rr] 0[Aa]{2})|((([A-Za-z]
[0-9]{1,2})|(([A-Za-z]
[A-Ha-hJ-Yj-y]
[0-9]{1,2})|(([A-Za-z]
[0-9]
[A-Za-z])|([A-Za-z]
[A-Ha-hJ-Yj-y]
[0-9]?[A-Za-z])))) {0,1}[0-9]
[A-Za-z]{2})$" />
<add key="FirstDayOfWeek" value="1" />
<add key="Environment" value="Test" />
<add key="AdminUsers" value="smithj,brownc,davist" />
<add key="ValidityPeriod" value="20" />
<add key="ExchangeRate" value="1.50" />
<add key="ExchangeRateEUR" value="1.10" />
<add key="EmailBody" value="Dear {0}\nThank you for your email, one of our operatives will be in touch shortly." />
</appSettings>

Yuk!

Here’s the good news: It doesn’t have to be this way. In fact, I would go so far as to suggest that there are no longer any good reasons to use the appSettings section. Yay!

Firstly, since .NET 2.0, we have the connectionStrings section, specifically designed for holding database connection strings. Tobin recently posted a nice simple example of how to handle connection strings for multiple developers / environments within a single source-controlled config file.

Secondly, there’s a whole bunch of settings in this example which would be better stored in the database, with administrative users given a front-end to manipulate the values when required. Otherwise, you end up relying on the likes of sysadmins to make changes to business rules, which can be more trouble than it’s worth.

Thirdly, and most importantly – for the remaining properties we can instead choose to use custom configuration sections to hold our settings in an organised, hierarchical way and strongly-typed manner. This is the de facto approach when developing shared class libraries, but is also really valuable for application-specific settings. This is nothing new – here’s a nice succinct blog post from Phil Haack in March 2007 explaining this technique – but in my experience it isn’t used frequently enough.

Page 1 of 212»