Wednesday 30 July 2008

.NET 3.5 Microsoft Courseware with IEEE Computer Society

I logged on to the IEEE Computer Society site for the first time in a few months today and got a pleasant surprise when I saw that at least some of the latest .NET 3.5 courseware is available free (usually £210.33 last time I looked) to members. It even includes courses on the ADO.NET Data Services and the Entity Framework.

I've done a few of the course they provide before including the Certified Ethical Hacker course, and a bunch of .NET ones. The only downside with the .NET ones is that (at least last time I did one) you don't get the virtual labs, you do get the exercises though so you can setup your own machine and work through them anyway. There are bucket loads of courses available to memebers on .NET, Java, Databases (SQL Server 2000, 2005 and Oracle 8 and 9i), Cisco, Adobe, business skills, IT Security, SharePoint (WSS and MOSS) and lots, lots more.


So if you're not an IEEE Computer Society member and you're thinking of doing any self-paced at home IT courses then I'd recommend joining because for the cost of buying one of these courses from Microsoft you can have a years membership, a great magazine (Computer) every month, and lots and lots of free courses!

Oh and well done to Microsoft for supporting IEEE Computer Society members in this way.

Monday 28 July 2008

Resharper 4 Bug with 'Use Format String'

I'd like to say first that I really, really like Resharper 4.0 and have made it my mission to persuade my boss to buy it for all of the Dev's where I work. I got my copy free at a NxtGenUG Southampton meeting and it continues to make my life as a developer easier.

But...

I've come across a small bug in Resharper 4.0 today, so I thought that I'd share so that others become aware.

Real code has been changed to protect the innocent (and because it belongs to my employer).

Start off with a StringBuilder.Append statement that uses the '+' operator to concatenate a string with an object. Why an object, well because that's what the code I'm working with has, not ideal, but that's working with legacy code for you sometimes.

Of course, using the Append statement with string concatenation isn't ideal practice either and what I'd like is to change it to an AppendFormat call. Now Resharper makes this very, very (seductively) simple.

Here's my example code before I let Resharper do its' thing:

Here's Resharper offering to do its' thing:


Here's the code that results:

The important line to note is that we now have:

stringBuilder.AppendFormat("{0} likes Resharper.", (object[])canBeCastToString);

Note the unnecessary cast to an object array. Because of this we now get the error:

System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Object[]'.

The solution is just to get rid of the superfluous cast to Object[].

I still really, really like Resharper 4.0.

Saturday 19 July 2008

You Grok What You Eat

Following on from conversations that I've had with various people recently it has struck me, and its' not a revolutionary thought, that my practice, and my thinking about my practice, is intimately linked to the feeds I subscribe to, the books I read, the events I attend, the people I chat with, and my work. So, as I finally got around to adding my ALT.NET Geek Code, I thought I'd write a short blog focusing on the feeds I subscribe to and some of the more influential (on me that is) books I have read in the last couple of years.

With feeds I of course subscribe to those of friends (see right) and I won't list them again as they are always present on this site. I'll start by giving a special mention to my two favourite blogs.

Ayende @ Rahein's blog has to be top of my list, his blog is a pure goldmine of ideas and inspiration and I'd thoroughly recommend his Hibernating Rhinos series if you haven't seen it.

Next up, Scott Gu, always interesting to see what MS is coming out with next.

After these two, here's the rest:

For books the list is a lot shorter.

First up comes Object Thinking. I just loved this book and will happily rave about it to anyone. Having originally read Social Anthropology at university and then gone on to do a masters in social science research methodologies reading this book brought together for me a number of thoughts that had been swirling around in my mind about the potential importance of insights from Anthropology, Sociology and other social sciences that are rarely given any attention in computing. In fact when I read it, I read it as much as a anthropology of the practice of software development as a book that gives great concrete guidance on the practice of software development. It wasn't until going to a great talk by Alan Dean at the Southampton NxtGen that I realised I had probably missed a lot of what the author was actually trying to communicate. I fully intend to reread it before too long in the light of Alan's talk.

Next is 'Domain Driven Design' by Eric Evans. A fantastic book that has really changed the way that I try to design and code software. Putting it here is almost as much of a cliche as citing Scott Gu's blog but to ignore it would be to not mention an important part of my diet. I actually came to read it as it had been used so much as a counterpoint in Object Thinking's sometimes quite duological arguments.

Agile Project Management with Scrum by Ken Schweber. The first scrum book that I read. Easy to read, every page is worthwhile.

C# In Depth by John Skeet. I haven't quite finished this yet but I'm going to give it a mention anyway because already it is the best 'code' book I've read to date. A lot of coding books that I've got and read have really frustrated me because they all seem to cover the same old, same old ground every time. Jon's book is focused on C# and avoids being drawn in to the framework which is fantastic because the last thing that I'd have wanted is another book with another chapter on ADO.NET, ASP.NET, databinding, etc... I saw Jon give a talk on C# a while ago and for me it was the best technical talk I have ever attended. He involved the audience and I left feeling that I had really learnt something. This book is almost as good as his talks.

If C# in Depth was a book that I hadn't finished reading then the next book is a book that the authors haven't finished writing! 'Brownfield Application Development in .NET' by Kyle Baley and Donald Belcham is, so far, great and represents everything that I am trying to achieve in my job at the moment. I can't wait for the later chapters to be released and would recommend it to anyone who has to transform not just a poorly designed and coded piece of software, but the practices and patterns of a team also.

Other books worth a mention include the GoF Design Patterns, CLR via C#, Object Oriented Software Construction, The Knowledge Creating Company, The Object Primer, Being Digital (now that's going back some).

So where does this diet lead me? See the ALT.NET geek code on the right.