Jan 26

Whenever I’ve wanted to create a SDK for my WebApi’s I’m surprised by the amount of bolierplate code you end up with. HttpClient made things easier for us, but you still end up wrapping HttpClient and passing generics around.

I wanted something between Simple.Data and angular’s $http service, the main driver was to make my tests as readable as possible. I’ve messed around with .NET 4 dynamic objects before, so I set about creating a dynamic wrapper around HttpClient and a fluent API I could re-use. It’s passed the rule of 3 as I’ve used it for multiple clients. A side note is that it should be trivial to generate DalSoft.RestClient code examples in your WebApi docs.

Continue reading »

Tagged with:
Jul 11

I’m currently contracting over @OnTrees, @OnTrees we use raygun.io for error logging. If you don’t know what raygun is – raygun logs errors and produces excellent trending reports. It’s a great tool because lets be honest no matter how good your test coverage is exceptions happen.

We use it in production to help prioritise and pinpoint exceptions, raygun is brilliant for this as it shows you a count and when the exception last occurred, everything you need for prioritisation decisions. Raygun is clever enough to know when a exception has been resolved or if it has been reintroduced by a new build which is a neat feature.

Continue reading »

Tagged with:
Jun 04

I program with different languages and for a while now I have wanted to make the K&R variant coding style my default in Visual Studio.

So what do I mean by the K&R variant coding style, this coding style was named after co authors of the book The C Programming Language (thank you Wikipedia!) Kernighan and Ritchie. The variant I like is based on Java – rather than taking up a new line I like the opening brace on the first line of the statement block.
Continue reading »

Tagged with:
Nov 11

In VB.NET you have always been able to use optional parameters:

Sub Foo(ByVal p1 As String, Optional ByVal p2 As String = "default value")
End Sub

'Call to Foo with 1 of the 2 parameters is allowed
Foo("p1 value")

Now in C# 4.0 we get the same support:

void Foo(string p1, string p2 = "default value")
{
}

//Call to Foo with 1 of the 2 parameters is allowed
Foo("p1 value");

Continue reading »

Tagged with:
preload preload preload