IanG on Tap

Ian Griffiths in Weblog Form (RSS 2.0)

Blog Navigation

August (2014)

(1 item)

July (2014)

(5 items)

April (2014)

(1 item)

March (2014)

(1 item)

January (2014)

(2 items)

November (2013)

(2 items)

July (2013)

(4 items)

April (2013)

(1 item)

February (2013)

(6 items)

September (2011)

(2 items)

November (2010)

(4 items)

September (2010)

(1 item)

August (2010)

(4 items)

July (2010)

(2 items)

September (2009)

(1 item)

June (2009)

(1 item)

April (2009)

(1 item)

November (2008)

(1 item)

October (2008)

(1 item)

September (2008)

(1 item)

July (2008)

(1 item)

June (2008)

(1 item)

May (2008)

(2 items)

April (2008)

(2 items)

March (2008)

(5 items)

January (2008)

(3 items)

December (2007)

(1 item)

November (2007)

(1 item)

October (2007)

(1 item)

September (2007)

(3 items)

August (2007)

(1 item)

July (2007)

(1 item)

June (2007)

(2 items)

May (2007)

(8 items)

April (2007)

(2 items)

March (2007)

(7 items)

February (2007)

(2 items)

January (2007)

(2 items)

November (2006)

(1 item)

October (2006)

(2 items)

September (2006)

(1 item)

June (2006)

(2 items)

May (2006)

(4 items)

April (2006)

(1 item)

March (2006)

(5 items)

January (2006)

(1 item)

December (2005)

(3 items)

November (2005)

(2 items)

October (2005)

(2 items)

September (2005)

(8 items)

August (2005)

(7 items)

June (2005)

(3 items)

May (2005)

(7 items)

April (2005)

(6 items)

March (2005)

(1 item)

February (2005)

(2 items)

January (2005)

(5 items)

December (2004)

(5 items)

November (2004)

(7 items)

October (2004)

(3 items)

September (2004)

(7 items)

August (2004)

(16 items)

July (2004)

(10 items)

June (2004)

(27 items)

May (2004)

(15 items)

April (2004)

(15 items)

March (2004)

(13 items)

February (2004)

(16 items)

January (2004)

(15 items)

Blog Home

RSS 2.0

Writing

Programming C# 5.0

Programming WPF

Other Sites

Interact Software

UAC: Don't be Part of the Problem

Wednesday 9 May, 2007, 11:15 AM

Are you a developer who has turned off UAC (User Account Control) on your Vista box? If so, did you stop to think about how UAC came about in the first place? Had it occurred to you that you might in fact be part of the problem?

The root Cause (da-dum, tish!)

The only reason we have UAC at all is because of a cultural problem: many developers run as administrators on Windows. This is a problem because developers who run as administrators will sooner or later end up writing something that doesn’t run properly under a standard user account. If you’re serious about testing how well your code works with normal user accounts, you soon discover that by far the easiest way to do this is to run as a normal user yourself—only if you are living in that world will you see normal user problems the moment they occur.

Unfortunately, a great many Windows developers have convinced themselves that they have to be running with administrative privileges at all times. Since they’re not really eating their own dog food, they never see and fix the problems, and so their applications never work properly when running under a non-admin account.

This is why Windows has UAC while UNIX and OS X do not. The culture is different on these other operating systems. On UNIX, you’d be considered nuts if you ran as root all the time. And if you wrote a program that demanded to be run as root for no good reason, your application would be shunned, and rightly so. Consequently, applications don’t get written that way on UNIX. This has the happy consequence that you only ever need to elevate when performing tasks that actually require it. OS X copied this tradition. But on Windows we have an unfortunate history of ordinary applications that demand admin privileges for no good reason.

If the Windows development culture hadn’t gone down this road we would never have needed UAC. Nobody would be running as admin for ordinary development work, so nobody would be writing applications that suffer from this problem. The origin of this culture may be that once upon a time it was nearly impossible to use Microsoft’s development tools without being an admin. But they fixed that years ago. Anything you still can’t cope with is therefore your own problem. (With apologies to DNA.)

(It's true that Microsoft recently added to the confusion by recommending that developers run Visual Studio 2005 elevated. This doesn't in fact seem to be necessary for an awful lot of scenarios. I regard this recommendation as being just one more contribution to the problem...)

So it disturbs me to see a rise in blog entries that take it as read that developers should turn off UAC, just like so many people used to take it as read that developers should run as admin. These people are advocating the very behaviour that caused the problem in the first place. In short:

Turning off UAC perpetuates the very problem that caused UAC in the first place.

Just How Bad is UAC?

One thing that continues to mystify me is how much some people talk up the problem. Obviously Apple does it for PR reasons—they’ve never been too bothered with accuracy in advertising. But what about people who spend most of their time developing software for Microsoft’s platform? I wonder what these people are doing wrong, because UAC really doesn’t seem all that bad to me.

Perhaps that’s because I’ve been running as a non-admin for years in Windows XP. This has two upshots. First, I’ve developed habits for being productive in a world where you don’t run everything elevated. For example, if you’re seeing lots of UAC prompts, here’s a handy tip that should get rid of them without needing to switch UAC off:

Leave an elevated command prompt running on the days when you need to do a lot of admin stuff. Everything you run from here will be elevated without further prompts.

Second, I know how awkward it was to live the non-admin lifestyle in XP. If you’re coming from that perspective, UAC looks like a massive improvement. And if you’re not coming from that perspective, then, well, you are part of the problem so you can only expect a limited amount of sympathy.

Maybe the UI where Vista lets you switch UAC off should make this clearer:

Windows Vista UAC configuration UI modified with note: 'It's people like you who brought about UAC in the first place...'

Developer, Patch Thyself

If you are a developer who has turned off UAC in frustration, remember that UAC is only this way because of all those software developers who insist on running as admin. It’s not Windows you should be looking to blame.

Take responsibility. Don’t be part of the problem.

Copyright © 2002-2013, Interact Software Ltd. Content by Ian Griffiths. Please direct all Web site inquiries to webmaster@interact-sw.co.uk