Thursday, July 04, 2013

WPF and COM

I’ve been working on a migration of code from VB5 to .Net. Due to the size of the project, I’ve been slowly migrating functionality over and using COM interop to call the new code from the old VB5 code base.

One little gotcha that I’ve stumbled across access to the Application.Current instance for the AppDomain. When called from VB5, Application.Current is null, and it’s read-only. Oh no!!

After a few minutes of play, it seems the fix is very simple.

if (Application.Current == null)
{
    Application newApplication = new Application();
}



That’s it. Just create a new Application instance, and the Singleton Application.Current is now referencing the newly created application.


* Yes, VB5 apps still exist in the wild.

Wednesday, June 26, 2013

2 Clicks to Shutdown!

The web is full of reviews from the new wave of 'Blue' coming out of Microsoft. Most articles seem to focus on the return of the start button. A fair number of these articles talk about how good it is that you can now shutdown your computer with 2 clicks of the mouse using the new start button. That's amazing. Two clicks!

Now, I'm starting to think I've been doing it wrong, as right now in Windows 8, I just press the power button once, with one finger. That was it, just one button, one finger, one click.  Clearly two clicks of the mouse is going to be so much easier... I can't wait!

Monday, June 17, 2013

Resistance is Futile

Well, maybe that’s a little over the top, but it’s an absolute waste of time.

Before reading below, I need to make it clear that I use Windows 8 without any tweaks, I use Visual Studio 2012 with just a few small add-ins (that add features to improve productivity), and in general just stick with the defaults for most things.

Now, to my point.

I’ve been watching a thread in a mailing list recently, talking about how to change Visual Studio 2012 back to the style of Visual Studio 2010. It’s a series of tweaks, add-ins, and ancient Indian rain dances, and once complete, Visual Studio will kinda look a bit like the older version, but not quite.

I’ve seen this same thinking over and over with people trying to revert Windows 8 (Start to Desktop, Start Button) back to the old ways and I’ve seen people installing old/unsupported versions of Office to avoid the ribbon.

My question is why? Is it about Productivity? Usability?  These are the two main reasons that people use when justifying these reasons. For me, I just don’t get it.

First I want to look as Productivity… This is the strangest one of all. I’m a keyboard masher, I do everything I possibly can to reduce the amount of time my hand is resting on the mouse. I’ve been in the Microsoft eco system for a very long time, and despite the fact that everything is graphical, a vast majority of the tools I use fully support keyboards. By this, I mean I can do everything I need to, quicker with just a keyboard. This applies mainly to Visual Studio and Windows. Productivity in Windows 8, despite the strange dual personalities, is on par if not better than Windows 7. The keyboard shortcuts I used still work, or there are now quicker ways to do things.

Visual Studio is the same. I type, I mash the keyboard, I press shortcuts. I tend to focus my attention on the code I’m writing, not on the upper case menus, the lack of colour that was supposedly taking my attention, or the strange flat icons.

This is really what productivity is about, it’s about being able to do your job, it’s about a tool not interfering with your work, it’s about a tool that automates every day tasks. Both Windows 8 and Visual Studio 2012 do this.

Then there is usability. Once again, I’m a keyboard masher, I’m not an icon hunter, and I’m even less of a menu monkey. Visual Studio introduced a feature called Quick Launch. Press Control + Q and type what your looking for. Visual Studio does the rest. That’s very usable (and productive).

Windows 8 is much the same. Just type what your looking for, right from the start screen. Yep, just type. No scrolling, touching screens, or strange gestures. If your on the desktop, just press the windows key then type. It doesn’t get any easier than that.

I’m sure you’ve all noticed that I left out office. The fact is that I’m now on the third version of office with the Ribbon toolbar. I can’t remember much about using older versions that didn’t have it. The only thing I do remember was searching through menus, clicking on tabbed windows trying to find something, only to realise I was in the wrong screen and having to look for another menu option that may be right. Now, I just click a tab or two on the ribbon and normally find what I’m after pretty quickly. Having said that, most of my work in office is typing content. The way you type content hasn’t changed a single bit. It’s still mashing a keyboard.

I know this has been a lot of rambling, but I think it’s safe to say I just don’t get the resistance to these newer products. Yes, they look different, and yes, they come with some downsides, but without any wasted time looking for ways to resist the change, I’m more productive now than ever before. That’s a win.