Monday, December 11, 2006


How weird to be back in the world of WinForms and ASP.NET control development, after so long in the realms of WPF betas and CTPs. Working on Windows and Web controls and components has a familiar and old-fashioned feel - like I know how to do everything that the spec requires, but that the results will be rather plain and rigid in appearance and behaviour.

Still there are compensations - not feeling that every surface will inevitably end up with a gradient fill; not having animations just because you can; having an infinitely higher level of confidence in the dev tools and the base class libraries which allows you to know that if things are going wrong it's definitely your own fault and not a buggy set of fundamental building blocks.

But it is also amazing how rusty you can get - leaving a branch of dev technology for a 12-18 month period brings on, for me at least, a Homer Simpson like phenomenon of the newer stuff pushing the old stuff out of the brain to make room; the shelf above my desk is currently groaning under the weight of tech books that I have had to bring to work as reference material.

And this is before taking into account the newer VS2005/CLR 2.0 stuff that I didn't really get to grips with as it was released - ASP.NET 2.0 is so different from 1.0/1.1 and because of the timing of its release, I never got the chance to enjoy the delights of Master Pages, Personalisation, the Provider model etc., etc.

The worry of course is that I will use older techniques or approaches to implement features and miss the opportunity to do things better by exploiting newer aspects of the technology - so rather than just using the tech books as reference material, I am carting them back and forth to and from work and trying to read them a bit more sequentially in order to get coverage of more than just the stuff I think of and go look up. So it's 'back to the classroom' so I can push all that WPF/XAML out of my brain again...ho hum.

Wednesday, October 25, 2006

CodeTidy Update

Listening in catch-up mode to past DotNetRocks podcast shows as I commute into work in the car (Milton Keynes to TVP takes about 1.5 hours each way each day), I came across a recent episode with Mark Miller of Developer Express in which they referred to a DotNetRocks TV episode he did showing off DevExpress's DXCore plugin framework for Visual Studio.

I didn't even know they did the DNR TV , but it sounded like it might contain something useful on doing tools for the VS IDE, so I took a look at the show and was amazed to watch as they used the DXCore framework to basically build a first-cut of CodeTidy! The DXCore basically contains a whole bunch of classes that wrap the IDE and provide access to code and code windows in a nice, comprehensive and logical way. Mark took less than an hour to put together an add-in that could sort the members of the current class/type in the editor window by visibility (private, public etc.) and type (properties, mem vars etc.) and a bit of sub-sorting of one category within another.

The design approach he took wasn't quite how I would have done it, but that is not important; what was important was how easy the DXCore framework made it to do things like grab a method and all its attached XML comments and queue up a delete/move operation on it along with all the others to make the sort operation consistent and undoable - all courtesy of calls to DXCore. Incredible.

So...I have grabbed the sample code that they thoughtfully made available and have gotten hold of a copy of the DXCore install (it is free) and plan to refactor/build on it to make a CodeTidy I can use in daily coding.

The session also allowed Mark to show off the tools that DevExpress actually charge for - Refactor and CodeRush - which looked pretty impressive too. Refactor does what it says on the tin and CodeRush is like intellisense on steroids with masses of customisable keyboard shortcuts for frequently used actions like newing up class and vars, creating if, while, for/foreach blocks etc. Could be a purchase coming on...

Essential WPF - Chris Anderson

I have been looking at draft chapters for Chris Anderson's forthcoming WPF book and it looks like it is going to be a great tech reference - lots of under-the-hood stuff and a nice logical progression through the major concepts.

More XAML-oriented than Charles Petzold's Applications = Code + Markup which I thought was (understandably) very code-behind oriented and procedural. Given that I think the most exciting thing about XAML and WPF is the declarative programming aspect, I think that books that focus on this side make more sense.

Original and Best - Chris Sells and Ian Griffiths original Programming WPF had the approach spot-on and I am really looking forward to their WPF-release update next year.

Thursday, September 28, 2006

CodeTidy Kickoff

Processing the code in a C# code file can be done in a few ways. Visual Studio has an extensibility/automation model that allows access to projects, solutions, modules, classes, code etc. as object collections; which would seem to be ideal for what I have in mind - not having to parse the stuff oneself.

However anytime I have looked at this in the past as a possible route for achieving the task of manipulating the raw code in a file I have come up against obstacles - most notably no support for locating and dealing with regions, some comments, namespace import (i.e. using) statements etc.

If I am to sort/arrange code without mucking up the containment of regions or orphaning comment lines, then I have to know about these parts of the text content of a code file and be able to manipulate them in the same way as the methods, properties etc. that are available as objects in the extensibility/automation model.

Parsing code files as raw text and recognising these 'contructs' manually seems like re-inventing the wheel and the sort of activity better done by people with more mathematical minds than mine, who thrive on lexical parser theory and and all that grammar/token recognition stuff.

So, what to do..? It would be nice to use the automation/extensibility model and fill in the gaps with a bit of manual parsing I suppose, but that leads to the need to effectively maintain my own 'meta-model' of the code being analysed that references/synchronises with the VS model but supplements it with information about the association of things like regions. Plus I need to take a fresh look at the VS model as I guess it has moved on and improved since I last looked at it (VS 2003) - though I'm pretty sure it still doesn't provide exposure of things like regions.

Further thinking required.

Tuesday, September 19, 2006

Pet Projects

I am a big fan of pet projects; by which I mean hobby code that I have developed and continually re-develop in order to learn new and newer versions of developer technology.

I have done this in the past with a Windows wallpaper changer taskbar app and a piano scale and chord finder utility. These have gone through various VB, Delphi and C# versions. Each time the familiarity with the 'requirements' means that I can use them as a comfortable 'problem-space' in which to try to utilise new features and rework code.

I am just about to start a new pet project - this time to sort code (initially C#) in code files according to configurable rules. I've always wanted a utility that would allow me to organise/group code in order of construct type (e.g. properties, ENUM, methods etc.) or access (private, protected, public etc.), taking account of regions and respecting comments and areas like namespace containment of imports (using statements) and allowing alphabetic sorting within these groupings.

Eventually I hope to make this an add-in to Visual Studio that will help me to organise my code in place and at the same time master the dark art of VS CodeTidy is born.

Thursday, June 29, 2006


Only those in similar circumstances can appreciate how damn annoying it is when people misspell your name. After years of suffering the frustration of having Mackie spelled as Mackay or Mackey (not to mention Gordan and Gorden), things have recently taken a much worse turn.

Somewhere, some business analyst or software developer has decided that they know best when it comes to the capitalisation of surnames that begin Mack... and have decreed that the K is to be capitalised. That same someone has managed to get their arbitrary rule incorporated into some of the most common CRM software in use in the UK. As a result, on countless mail-outs from the banks, high street stores, credit card companies and other large organisations, I have become Gordon MacKie.

Now, even when I point out this misspelling to them, by letter or in person when my details are being taken in a shop for entry into their customer database, the spelling cannot be changed as the software will not allow it; despite willing employees retyping the entry, as they type the k it automatically and stubbornly becomes a K

Argggggh!! Stop it!!

Stop dictating to me how to spell my name! I know how to spell my own bloody name!

Unless I and the Mackenzies, Mackinlays and other Macks of the world fight this, then it won't be long before the casual observer will assume that this is the correct rule for the spelling of our surnames. We need to resist this outrageous abuse before it's too late.

Monday, April 03, 2006

First post...

I don't like blogs generally - in principle they are a great idea, in practice they are often not much more than an electronic version of vanity publishing. Just because you have an opinion doesn't mean that the whole world has to hear it or that your views are any more valid for being blogged. The Your shout approach only works if you know what you are talking about. All too often I find myself agreeing with Sid Vicious' response when he was asked about 'the man in the street' - track the quote down...Tony Wilson is fond of using it.