Getting the Right Visual Studio Add-In

Give me the right tool and I can use it to create just about anything in code! It’s a bold statement and I’m sure that I’d have little trouble finding a lot of other developers who believe precisely the same thing. Unfortunately, finding the right tool is akin to finding a needle in a haystack (feel free to substitute any other worn cliche you can think about). How does someone quantify the usability of a tool or decide whether to even download it in the first place. I recently wrote an article for Software Quality Connection entitled, “Techniques for Finding Useful IDE Add-ins” that answers that question. The article proposes some techniques you can use to make the process of finding just the right add-in easier.

Of course, my great add-on is a piece of junk for you. Our needs, goals, programming skills, and programming tasks differ. So, what I’d like to know is how you look for add-ins and how you use them to create better applications. It’s nice to get another perspective on a given topic. Over the years I’ve talked with hundreds (perhaps thousands) of readers about the tools they use because the right tool in the right hands can do amazing things. Most of my books contain a healthy number of links to various tools and I often employ add-ins in my books to make tasks easier. Let me know about your favorite add-in and tell me why you think it’s so great at (Please, no vendor e-mails. I already know your tool is great; I really want to hear from people in the trenches on this topic.)

Part of my reason for asking this sort of information is to improve the quality of my books and articles. Quality is extremely important to me. In fact, it’s the reason I created the beta reader program. A beta reader reviews my manuscript as I write it. You can find out more about the beta reader program in my Errors in Writing post. If you want to become a beta reader, just write me at for additional details. In the meantime, try out some new add-ins and have a bit of fun .

Supporting Sensors in Windows 7

Windows 7 includes an amazing set of new features and I describe how to develop applications to use them in my book Professional Windows 7 Development Guide. One of the most amazing new features is the ability to work with sensors of all kinds within your application. In fact, I found this particular technology so compelling that I used an entire chapter to discuss it. Chapter 18 tells you about various sensor types and how to use them in your application, including:


  • Biometric (such as fingerprint and retina readers)
  • Electrical (devices that output some sort of electrical current that don’t fit in another category)
  • Environmental (devices that measure environmental conditions such as temperature and humidity)
  • Light (a device used to measure either the amount of light or a specific kind of light)
  • Location (usually refers to GPS devices, but Windows 7 supports other types)
  • Mechanical (defines a mechanical measurement, such as how far a door is open)
  • Motion (detects any sort of motion)
  • Orientation (measures angular rotation around the center of a mass in one of three axis: yaw, pitch, and roll)
  • Scanner (any device that contains a CCD and is used to capture an image, such as a camera or scanner)

Sensors are created from either hardware (with a driver) or software. The software sensors include a special software sensor, Geosense for Windows. The builder of this software sensor, Rafael Rivera, was kind enough to spend several hours with me online explaining precisely how sensors work in general and this sensor in particular. Geosense for Windows is a great way to discover Windows 7 sensors because you don’t need to buy anything special to experiment with it.

Rafael was also nice enough to provide a review of my book recently. You can find it on his Within Windows blog. If you have an interest in sensors or simply want to find out more about my book, please be sure to read Rafael’s review. Of course, I’m always available to answer your book-related questions at


Using a Horizontal Web Site Layout

A friend recently wrote to me regarding an issue with Web site layout. Of course, I’ve dealt with Web design issues in a number of my booksmost notably C# Design and Development and Accessibility for Everybody: Understanding the Section 508 Accessibility Requirements. If you look at most Web sites today, they all have three serious problems:


  • The line length is too longforcing the eye to work extra hard to read the material because the eye loses track of the line and actually making it tiresome to review the material.
  • The page contains too much material, which makes it tiresome for anyone working with a screen reader to listen to all the material before finding the one bit of information actually required from the site.
  • The use of vertical scrolling is contrary to the historical use of horizontal scrolling. If you look at how people worked with scrolling in ages past, it was always horizontal, making it easier to read the material.

She even sent me two articles that describe the problem in greater detail. The first article is entitled, “Are Horizontal Website Layouts the Wave of the Future?” and points out that research shows that most people don’t even read the excess material on a Web site. If nothing else, the strong research showing that my efforts are being wasted would tend to make me rethink my design. The second article is entitled, “Horizontalism and Readability” and it places more emphasis on the historical approach to horizontal layout, rather than focus on modern research. I tend to prefer tested approaches to presenting information when I can get them (new ideas are fine for someone else to test).

Of course, a Web site is not the same as printed material. Trying to equate the two could very well be a mistake. Here is my take on how the mediums differ:


  • The method of presentation differs. You’re not relying on paper, you’re using a video screen of some sort and that does make a difference in how the reader perceives the material.
  • The environment differs. I don’t usually sit in my easy chair next to the fire when I read materials online. I’m normally in my office in a formal work environment.
  • The approach to reading differs. My paper reading environment is relaxed and long term. It’s nothing for me to spend an entire day reading a good book. My online reading is more like a sprintI find what I need quickly and never read for more than a half hour at a time.
  • The technology differs. When I read a book, I get print in one size. So, if the print is less than appealing or causes eye fatigue, I’m just stuck with it. My browser allows me to change the font size a Web site uses so I can make the print eye friendly. In fact, I can even use a CSS file to change the typeface and other features for some Web sites.

The obvious question now is whether the two environments differ enough that considerations normally made for paper don’t apply to Web sites. My thought is that creating Web sites with smaller amounts of material, eye friendly design, and shorter columns are all great ideas, but I’m not completely sold on the idea of horizontal scrolling. What is your take on this idea. Let me know at

Simulating Users with the RunAs Command

One of the problems with writing applications, administering any network, or understanding system issues is to ensure that you see things from the user’s perspective. It doesn’t matter what your forte might be (programmer, administrator, DBA, manager, or the like), getting the user view of things is essential or your efforts are doomed to failure. Of course, this means seeing what the user sees. Anyone can run an application at the administrator level with good success, but the user level is another story because the user might not have access to resources or rights to perform tasks correctly.

Most knowledgeable users know that you can simulate an administrator by right clicking the application and choosing Run As Administrator from the context menu. In fact, if you Shift+Right Click the application, you’ll see an entry for Run As A Different User on the context menu that allows you to start the application as any user on the system. However, the GUI has limitations, including an inability to use this approach for batch testing of an application. In addition, this approach uses the RunAs command defaults, such as loading the user’s profile, which could cause the application to react differently than it does on the user’s system because it can’t find the resources it needs on your system.

A more practical approach is to use the RunAs command directly to get the job done. You can see some basic coverage of this command on page 480 of Windows Command-Line Administration Instant Reference. To gain a basic appreciation of how the user views things, simply type RunAs /User:UserName Command and press Enter (where UserName is the user’s fully qualified logon name including domain and Command is the command you wish to test). For example, if you want to see how Notepad works for user John, you’d type RunAs /User:John Notepad and press Enter. At this point, the RunAs command will ask for the user’s password. You’ll need to ask the user to enter it for you, but at that point, you can work with the application precisely as the user works with it.

Of course, many commands require that you provide command line arguments. In order to use command line arguments, you must enclose the entire command in double quotes. For example, if you want to open a file named Output.TXT located in the C:\MyDocs folder using Notepad and see it in precisely the same way that the user sees it, you’d type RunAs /User:John “Notepad C:\MyDocs\Output.TXT” and press Enter.

In some cases, you need to test the application using the users credentials, but find that the user’s profile gets in the way. The user’s system probably isn’t set up the same as your system, so you need your profile so that the system can find things on your machine and not on the user’s machine. In this case, you add the /NoProfile command line switch to use your profile. It’s a good idea to try the command with the user’s profile first, just to get things as close as you can to what the user sees. The default is to load the user’s profile, so you don’t have to do anything special to obtain this effect.

An entire group of users might experience a problem with an application. In this case, you don’t necessarily want to test with a particular user’s account, but with a specific trust level. You can see the trust levels setup on your system by typing RunAs /ShowTrustLevels and pressing Enter. To run an application using a trust level, use the /TrustLevel command line switch. For example, to open Output.TXT as a basic user, you’d type RunAs /TrustLevel:0x20000 “Notepad C:\MyDocs\Output.TXT” and press Enter. The basic trust levels are:


  • 0x40000 – System
  • 0x30000 – Administrator
  • 0x20000 – Basic User
  • 0x10000 – Untrusted User

Many people are experiencing problems using the /ShowTrustLevels and /TrustLevel command line switches with newer versions of Windows such as Vista and Windows 7. The consensus seems to be that Microsoft has changed things with the introduction of UAC and that you’ll need to work with the new Elevation Power Toys to get the job done. I’d be interested in hearing about people’s experiences. Contact me at

Inheriting Someone Else’s Code

In my book, “C# Design and Development,” I propose a lot of management techniques that could apply to any language. In fact, I’ve used the techniques in this book successfully for years with Visual Basic, C#, IronPython, C++, and PHP, among many others. The idea behind the concepts in this book is to create code that performs well from the outset and is easy to maintain when changes are required. In today’s environment, you can count on changes at some point. There are many reasons to expect changes:


  • The business is bought by someone else and the code must be integrated into a new system.
  • A change in some other component necessitates a change in the application (such as the changes in Vista and Windows 7 security).
  • The business has grown and now needs new features to support its customers.
  • Modifications in the law mean changes to the way the application interacts with data.
  • Technology changes in such a way that the application no longer works properly.

In fact, the reasons for change are endless. I could probably continue writing reasons for change for hours and not cover even a small number of them. The point is that applications will change at some pointit’s simply a matter of time.

If you’ve written code for any time at all, you know that feeling in the pit of your stomach when you discover the perfectly lucid comments you wrote at the time you created the application are no long lucid now. Worse still, the documentation you put together doesn’t tell you what you did and why. Still, after a few hours of looking at your comments and documentation, you can usually begin to fit the pieces together of an application you created because you can recreate the thought patterns you had when you designed and wrote it in the first place.

However, what happens when you’re part of a team or you’re working on an application that someone else designed? Now there isn’t any way to “get back into the groove” of what you did in the past. The thought processes are foreign, so the comments and documentation have to be as comprehensive as possible. Even with great comments and documentation, it’s going to take a while to get up and running with the code.

The longer it takes you to recreate the ideas that went into creating the code, the longer the project update languishes and the more extreme management’s position becomes. The only thing that management knows is that your application (the one you inherited from someone else) is costing the business money. Not only is there a cost associated with the update, but the delay costs the organization money too. Users who have to fight with an outdated application are always unhappy and aren’t productive. So, what techniques can you use to become productive as quickly as possible? That’s what I’d like to know as well. Obviously, reading the documentation and comments are two pieces to the puzzle, but what other techniques do you use?

I’m currently putting an article together that discusses this topic in detail and I’d like to hear about your techniques. If you’ve ever been frustrated by someone else’s code, write me at I’ll let you know when the article is published on Software Quality Connection