The Blog

I never knew that was there

In Visual Studio, I use Ctrl+F12 to go to the implementation of a method. Just now, I accidentally pressed Alt+F12 and what happened next blew my mind. An inner editor window opened under the line of code I was on, with the code for the method I wanted to see visible.

I have no idea what this feature is called, or whether it is from Visual Studio or Resharper, but I'll be using it a lot, especially with test-driven development.

Update: I just googled it, and it's called Peek Definition.



Inner Editor

Being more organised

I was talking to a self-confessed disorganised person recently. I used to say I was disorganised, but I've put so many systems in place over the years to counter this, I might well now be considered organised. Anyway, here are a few of my systems, for his benefit, and anyone else.

Phoning myself

If I'm at work, and suddenly remember something I have to do at home, I'll phone my home landline and leave myself a message on the answer machine. When I get home, I'll see there's a message, and play it. "Hi Simon, it's Simon. Don't forget to ..."

Likewise, when I'm just about to drift off to sleep, I often remember something to do at work, so I'll phone my work voicemail.


If I have to remember to take something with me when I go out later, or in the morning. I leave it on the front doormat. When it's time to go out, I would have to move it to open the door, which reminds me it needs to come too.

Homes for things

Everything should have a home. Whenever I finish using something, I put it back in it's home. It doesn't matter how random or strange the home is, so long as it lives there. My hammer lives in the bottom of the coat cupboard, for example. It's always there, unless I'm using it, and then it goes back.

Keys, phone, wallet

The holy trinity of misplaced objects. Again, these need homes. Two homes. One home for when I'm out and about, and the other for when I'm in my home. The first home is in my trousers. Phone and wallet in my front left pocket, keys and coins in my front right. They will always be there, unless I'm using them, and then they go back. They don't go in my jacket pocket, or in a back pocket, or on the table at the pub, or anything else. They stay in their pocket.

At home, when I go to bed, I put my phone on to charge, next to my bed, as I use it as an alarm clock. When I get dressed, I put it in my trousers. My keys and wallet live in my trousers overnight. If I want to wear different trousers, I transfer everything across before putting them on.

It sounds like a bit of hassle, and perhaps it takes a while to get used to, but once it becomes habit, it doesn't require any thought, and you'll always know where they are.

Camera phone as a notepad

I realised a while ago that taking notes isn't always practical, and taking photos of things is a super quick way to remember things. I use it to take photos of books that I might want to buy in the future, notes that have been scribbled on a bit of paper that will probably get lost, timetables and so on.

Turning around before walking out

When leaving a café or restaurant, I turn round for a last look at the table before walking out, to make sure I've not left anything on or under the table, and not left my laptop charger plugged in. It's now a habit.

Pre-packed laptop bag

I make sure that I have anything I could need in my laptop backpack, and they live there until used, and go back: mains adapter, phone charger, mouse, notepad, pen, business cards, deodourant and penknife. Whenever I go out with it, I know all I need to do is put my laptop in the bag, and I'm ready to go. I've had to buy a spare charger and mouse, but it's worth it to save the hassle of forgetting them.

Calendar and diary

This used to be such a problem with my wife and I double-booking things, but we've finally solved it using a shared Google calendar, synchronised on our phones. Don't book anything until you've checked the calendar on your phone.


I use Dropbox, but there are other things that are just as good. The important thing is that it is automatic. My phone automatically uploads photos and my computer files are saved in dropbox folders by default. Once it has been set up, it doesn't need thinking about.

On the way home could you just ...

When I used to commute by car, and had something to do on the way home, I'd often arrive home having forgotten to do it. The reason was driving on autopilot. I solved this by working out exactly where I needed to change my normal route - the particular junction. Before setting off home, I'd visualise it, and when I came up to it, I'd remember to turn off. Once I'd turned off, I wasn't on my usual route, so I wouldn't forget any more.


Continuous JavaScript Testing

Being used to NCrunch continuously running my unit tests as I type, I was looking for a similar solution for my JavaScript tests. I'm using Jasmine, which runs from a single HTML page. When I want to re-run the tests, I manually refresh the page in the browser.

Obviously this is a PITN, so by adding a meta tag I kept from the 90s, I've got my page refreshing every 2 seconds and running the tests.

<meta http-equiv="refresh" content="2">

Ninject Controller Testing

I've been converting an old, large project to use NInject to inject services and repositories into my controllers, removing the base controller's code that newed them up. I wrote a handy unit test to make sure all the bindings worked for the controllers' constructors, which caught a few missing bindings before it passed.

public void Can_create_controllers()
    var kernel = new StandardKernel();

        .Where(t => typeof(Controller).IsAssignableFrom(t))
        .ForEach(c => kernel.Get(c));


Footballers on your software project team

Different roles in the software team map rather nicely to various types of footballer.

Developer: Striker

The player that actually achieves the goals of the project. Makes things happen, and gets the credit for a good result. Best paid.

Tester: Defender

Stops bad things happening, but nobody notices them until a bad thing happens. Any good things they do, they pass on to a striker, who will then do another good thing and take the credit.

Project Manager: Midfielder 

Organises everyone around them, does lots of chasing about, convinces everyone that they're a necessary interface between the defenders and strikers to encourage a beautiful game and prevent long-ball development.

Graphic Designer: Tactician or Performance Analyst

Fully-trained expert in their field whose input and ideas are sought and ignored by the players. Because any player or coach can come up with a tactic that looks good to them on paper, and the results are hard to measure without comparisons, they're seen as optional and expendible when there's a limited budget.

Client: Goalkeeper

Supposedly supplies content and photographs, but mainly just shouts at the other players when something has gone wrong and it's too late to do anything about it. Too often just kicks the bug right up to a striker, when they should throw it short to a tester.

Users: Fans

Will let you know instantly if they don't like anything without suggesting a better solution, even though they know they can do a better job than just about anyone on the team. There'll be a few that are always singing no matter what, and the manager will try to please them even if it doesn't make financial sense to.