CsvReader now on GitHub

Paul Hatcher
Posted in Integration
A number of years ago Sebasiten Lorion wrote a very good CSV parser for .NET with the code and an accompanying article on Code Project - A Fast CSV Reader. I’d used this in a number of projects but recently I needed to make some changes to the code for my trading system project, and there wasn’t a public repository available; there’s a version on NuGet but it doesn’t point back to the source.

MVC Areas Anti-Pattern

Paul Hatcher
Posted in Patterns, MVC
I was working on the design of a small site where we have public display of information in one format and a set of administrative screens that allow authorised users to create and edit the information. “I know”, I thought, “this is a perfect case for MVC Areas” – and boy was I wrong! I should have realised that the problems had started when all the routing started playing up..

Route Testing and MVC 2.0 Areas

Paul Hatcher
Posted in MVC
I’ve been using the MvcContrib.TestHelper class for a while now to get rather nice fluent testing of the routes in my MVC applications. A typical test class would look like this public class CategoryRoutesFixture : RoutesFixture { private const int categoryId = 34; private static string BaseUrl { get { return "~/admin/Category"; } } [Test] public void Index() { BaseUrl.ShouldMapTo<CategoryController>(x => x.Index()); } [Test] public void Create() { (BaseUrl + "/create").

Algorithm Performance

Paul Hatcher
Posted in Algorithms
I was chatting to a colleague recently who although he was a very good programmer, did not have a computer science/maths background – this was fine until he wanted to use bubble sort on a large(ish) (100k) number of records and I had to explain to him about how algorithms that take n2 time are not your friend for big (or even little) n. One of the most important decisions you can make when optimizing an application is the up-front choice of algorithm to use, performance tuning and optimization can make a difference but you are very lucky to achieve 2x-5x improvement, to be able to make 10x or 100x improvement in your application you need decent algorithm choice.

Automating Visual Studio Templates

Paul Hatcher
I find Visual Studio Item Templates very useful, but a lot of teams I encounter haven’t really adopted them as they can be a pain to construct. Here’s the technique I use to manage the templates and make it painless to add new ones and modify existing templates if they need to change. What we do is put the templates into source control and then use a build process to automate the production and distribution of the zip files.