January 2008 Blog Posts

Datasets are Evil

There are many things I like about the .NET Framework Base Class Library, but of these things DataSet is most definitely not one of them. Every time I see it used I know I'm about to enter an untestable world of bad code pain. And I blame the people who write example code.   The web is littered with examples of grabbing data from a database, dropping it into a DataSet then binding that to a control to display to an end user. Some of the more advanced abominations will include editing and paging code. Junior developers take inspiration from this code...

posted @ Thursday, January 31, 2008 2:23 AM | Feedback (1)

Things I don't do anymore #1

There's very little that depresses me more professionally than coders who never try to improve how they do things. These are the kinds of people who've been writing unmaintainable 500 line switch statements for the last decade and resist all attempts to show them a better way. This topic is worth a rant in it's own right, this post is on how I try to avoid this fate by identifying development practices I have that I need to improve or replace.   I like .NET resources. They make it relatively easy to store common strings and such in a manner than allows...

posted @ Thursday, January 24, 2008 2:22 AM | Feedback (0)

No Resharper with C# 3.0 support makes Colin go something something...

I've been doing some development with the new C# 3.0 features which means I'm faced with two unpleasant alternatives: Disable ReSharper and deal with the low level stress of a sub-optimal development environment. Keep ReSharper enabled and have to deal with the autocomplete issues and code analysis failures when dealing with C# 3.0 features. Neither alternative is particularly pleasant. I'm turning into a forum junkie, checking constantly for signs that an EAP version has been released. It's not pretty. 

posted @ Thursday, January 24, 2008 2:21 AM | Feedback (0)

I've found my dream job

I want to be a presenter on Top Gear - Australia. Unfortunately I don't know anything about cars. Damn them and their requirements of competence.   Maybe I could convince them that they need someone to offset the other presenters. Someone who's willing to lose all the races and screw up all the challenges. Someone who'll sign any kind of waiver their legal department produces.   No?   Dammit.

posted @ Tuesday, January 15, 2008 2:21 AM | Feedback (0)

Sometimes going backwards prevents going forwards

As of .NET 2.0 Microsoft introduced significant new configuration capabilities into the .NET Framework. This made building configuration into your application significantly simpler. For backwards compatibility reasons the previous configuration support was retained. This was necessary so applications from previous versions could run on the new framework.   The new functionality has the ability to generate configuration files by building a configuration object graph then saving it out. This seemed like quite a useful capability for a tool I'm constructing to generate configuration files. Unfortunately configuration code that uses the pre .NET 2.0 system uses an interface (IConfigurationSectionHandler) that is (as far...

posted @ Sunday, January 13, 2008 2:20 AM | Feedback (0)

Sessions are evil and other problems with making the stateless stateful

Way back in the dark ages the world wide web was created as a means of sharing static content. For various good reasons HTTP was made a stateless protocol. This conserved server resources as a client only consumed scarce resources (such as memory and network connections) during the processing of the request. As the requests are bursty this allowed many more clients to use a server than in a more traditional network application where clients have persistent connections and tie up resources for long periods.   In the beginning this was fine but as people started to use it more this became...

posted @ Thursday, January 10, 2008 2:20 AM | Feedback (0)

Books on my fiction To Read list

One of the reasons I'm running out of shelf space is the number of books I buy, which I like to think of as more than the average. One hazard of buy a lot of books is that I tend to fail to finish some (or in extreme cases not even start them). This is the list of books that are currently on my list to read.   Books to get around to finishing: The Night Watch by Sergei Luyyanenko Emperor: Time's Tapestry Book One by Stephen Baxter Emissary (Percheron Book Two) by Fiona McIntosh World's End (Sandman, Book 8) by Neil Gaiman...

posted @ Wednesday, January 09, 2008 2:19 AM | Feedback (0)

Visual Studio 2008 corner case wierdness

Visual Studio provides three different view modes for .aspx, .ascx and .master files: Design, Split and Source. Design shows a near-WYSIWYG interface, Source shows the HTML markup and Split shows a combined view with the source on top and the design below it. I've found a corner case that can stop the design view (standalone or as part of the split view) rendering inside Visual Studio but that doesn't seem to affect its operation at runtime. Take a standard head tag configured to be a server control, as shown below. This works normally as you'd expect. But if you're excessively pedantic...

posted @ Sunday, January 06, 2008 2:18 AM | Feedback (0)

Technical Interviews

I've been asked to assist in the technical side of some interviews (apparently we're hiring). I'm not going to discuss any of the specifics of the candidates or positions, but this has got me thinking about evaluating technical people in interviews.   There seem to be a number of schools of thought as to what constitutes the kind of questions you should be asking a potential technical hire. Some I've seen are: Ask abstract logic puzzles. Microsoft used to be well known for this, I have no idea if this is still the case. ...

posted @ Saturday, January 05, 2008 2:17 AM | Feedback (0)

Switch statements should only be available on prescription

One of the most consistent features I see in codebases that are in need of refactoring are developers doing terrible, terrible things with switch statements. They start out as small, manageable things but over time a series of expedient changes leaves you with a 1000 line long abomination full of duplicate code, hidden dependencies and unresolvable bugs.   One of the problems is that in most cases it seems so much more efficient to use a switch statement than the alternatives which generally need at least a couple of new classes. For a few cases this may be true but as the...

posted @ Friday, January 04, 2008 2:17 AM | Feedback (0)

Review: The Golden Compass

I've just seen The Golden Compass which has exceeded my expectations. I expected all the religious elements of the books to be missing, which would have gutted the story. This was not the case although the movie treatment is (as with a number of the other elements) significantly lighter than in the books.   For those who have not read the books or seen the movie, there are spoilers below. Go read the books then come back.   First the negative elements. The start of the film has a voiceover that has too much information. There is always a problem in getting all the...

posted @ Wednesday, January 02, 2008 2:16 AM | Feedback (0)

Generalists vs. Specialists

Software developers are a highly diverse group, in large part due to the wide variety of software types out there. One of the categorisations I see is how they fit on the scale between generalist and specialist and what impact this has on the kind of system you get from developers from different points along the scale.   A generalist is someone with a broad knowledge of many technical concepts, but with shallow knowledge of specific topics. At the extreme this would be someone who knows almost nothing about almost everything. A specialist has a much narrower range of knowledge, but their...

posted @ Wednesday, January 02, 2008 2:15 AM | Feedback (0)

Times, timezones and databases

Recording the time of an event is a critical function in many systems. What many developers fail to realise is that the time they're recording is ambiguous because they're not taking into account the timezone from which the time was sourced. Many applications can get away with this because their usage patterns don't expose the problems. On more significant applications it can be a real problem.   Consider daylight savings in an application that uses the current local time. When the clock moves forward there isn't a huge problem, although if you're trying to generate statistics or measure service level agreements this...

posted @ Wednesday, January 02, 2008 2:14 AM | Feedback (0)