Key Bindings

When I was at college studying Electronics and Computer Engineering, we used a piece of software called Proteus. This software took a long time to get used to due to its interesting key bindings and mouse usage. To select a track in Ares (PCB Layout package) you Right Click on it. Hmm not too standard, but okay, I can live with that. Now what happens if you were to right click on that track again?...

July 17, 2009 · 2 min

CI: Thoughts on CC.Net and Hudson

I have been a fan of CI (Continuous Integration) for a long time now, and ever since I started with CI I have been using CruiseControl.Net. CCNet is incredibly powerful; you can make to do practically anything, and writing plugins for it is a breeze. However, I do find that the config files get rather messy. I have tried many things and the current best solution seems to be to have one ‘master’ config file with a set of includes to other files....

July 14, 2009 · 2 min

Overuse of the Var keyword

When I first got hold of VS2008, and had a play with the new version of C# I loved the Var keyword. To me the most amazing thing was no more declarations like this: System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex(); Instead I could write the following: var rx = new System.Text.RegularExpressions.Regex(); Making it akin to VB developers being able to write: Dim rx As New System.Text.RegularExpressions.Regex() (I have had however to cope with a coding standard that explicitly forbid this declaration in VB…Backwards or what?...

June 29, 2009 · 2 min

Coming From Something as opposed to Going To Something

Over the last week I have noticed myself preferring methods being called IntegerFromString rather than StringToInteger. Is sometimes takes me a little longer to read (only a few milliseconds, mind) but I think I am getting more used to it, and I do think it enhances readability. The main point for readability comes from the fact that I work a lot (in my spare time when coding) on graphics processing in GDI....

June 19, 2009 · 2 min

Fluent Validation

A few days a go i was going through my bookmarks, and came accross this post on the GetPaint.Net blog about using a fluent interface for parameter validation. After reading the article, I tried the code out at home, and was very impressed. Not only does it read well, but also does not create any objects untill a piece of validation fails. Very nice. However i wanted to use this at work, and this presented me with a problem....

June 12, 2009 · 2 min

The Reading List

I have been meaning to write my own version of Jeff Atwood’s Reading List for a while now, and have finally managed to find some time to write about the books I have read. Code Complete 2 I found this book quite tough reading. It wasn’t that it had nothing of use in it - far from it, it just was fairly heavy going. There are many things that can be learnt from this to help with the whole process of development, from how to name variables and functions to what the useful methods of development planning are....

June 5, 2009 · 2 min

Converting Code

Quite often (well ok, not that often) I am asked why I convert most C# code I find into VB.Net. The main reason is I find that it helps me to understand the code. To put it into perspective, my Test Projects directory contains around 50 projects with about a 50/50 split of C# projects and VB.Net projects. When I come across a sample online (often in a blog) it is either small enough to be understood straight away, or something much larger that needs a lot of thinking and looking at (look at Jeremy Miller’s Build Your Own CAB Series) to fully understand....

June 1, 2009 · 2 min

Microcontrollers for MenuItems

I have been working my way through Jeremy Miller’s excellent Build Your Own CAB Series (which would be even better if he felt like finishing!) and was very interested by the article on controlling menus with Microcontrollers. After reading it and writing a version of it myself, I came to the conclusion that some parts of it seem to be wrong. All of the permissioning is done based on the menu items which fire ICommands, and several menu items could use the same ICommand....

May 29, 2009 · 5 min

Generics to the rescue! Again!

I was writing a component at work that has many events that all need to be thread safe, and was getting annoyed at the amount of duplicate code I was writing: Public Event FilterStart(ByVal sender As Object, ByVal e As EventArgs) '... Private Delegate Sub OnFilterCompleteDelegate(ByVal sender As Object, ByVal e As FilterCompleteEventArgs) '... Private Sub OnFilterComplete(ByVal sender As Object, ByVal e As DataAccess.LoadEventArgs) If _parent.InvokeRequired Then _parent.Invoke(new OnFilterCompleteDelegate(AddressOf OnFilterComplete), new Object() {sender, e}) Else RaiseEvent FullResultsStart(sender, e) End If End Sub '....

May 22, 2009 · 2 min

Using Laziness

As I do a lot of forms development, I end up writing something like this a lot: Try pnlSomething.SuspendLayout() '... Finally pnlSomething.ResumeLayout() End Try Now as I am lazy, I thought I could make a class to do this for me: Public Class Layout Implements IDisposable Private _control As Control Public Sub New(ByVal control As Control) _control = control _control.SuspendLayout() End Sub Public Sub Dispose() Implements IDisposable.Dispose _control.ResumeLayout() _control = Nothing End Sub End Class It is used like this:...

May 19, 2009 · 1 min