Watch How Your Users Use Your App

If you develop applications at your company and another group there uses it to do the actual business of the company, have you actually seen how they use the software? Seems a bit crazy, right? You developed it, so of course you know how it works! Not quite so. The people who use your applications all day every day at work will find little nuances about it that you never would have dreamed of. They'll take six clicks to get something done when you thought it only would take two.

You won't really know how they use it until you sit with them and watch them for a few minutes. Requesting this to your boss should show that you care enough about the business to help out the productivity of the users and the quality of the software you give to them. To get an even better idea is to see if you can actually do a little bit of what they do to get the full effect. Then take notes...anything that comes to mind. How do you think this can be improved? What issues were you having to accomplish a certain task? Were there any performance problems that had you waiting for a task to complete? Could something be done simpler to minimize the user (in this case, you) from having to think about what should be done on the page?

I actually propose the whole team to do this. Then once everyone has finished, compare notes and even have a small meeting on all the things that can be improved.

I just did this today and saw massive productivity improvements and you can bet I'll share them with the team as soon as I review my notes.

Sunday Link Roundup

What's a Sunday without some links? Here's a couple of stuff I found interesting this past week.

Why You Should Use OneNote

Very rarely will I push a piece of software that I believe people should use. Of course, what software you do use is quite a personal choice. However, there are pure gems out there that I just can't let it stay unknown for much longer to everyone I believe can benefit from it. Microsoft OneNote is the one I consider a true gem. What can you do with it, exactly? Well, you can use it to write/draw/screen cap anything you'd like! It's a blank canvas for you to use however you wish. Why would you use it? It basically gives you a virtual notebook and you can organize it how you would like, though it keeps with the traditional notebook organizational hierarchy such as tabs (or sections) and pages. There are even some templates to help get you started such as to-do lists, travel plans, shopping lists, etc. However, I use it to literally take notes. Whether it's for studying, notes from various readings, or just random thoughts that go through my head.

As you can tell from above screenshot, I just break my notebooks out by general category and break the sections and their pages up to be more specific. You may also notice that you can nest pages to create a bit of a hierarchy.

Of course, what's the use of all these notes if you can't get to them easily. OneNote has a great search feature. You can either search throughout the one page or through the whole notebook. If you have a Windows 8 tablet with a pen, you can download the Windows RT OneNote app and you can take handwritten notes and OneNote will search those as well!

There is also a mobile app regardless of what type of phone you have. So you can have all your notes available to you at any time. One great way to use this is to have an easy access to a page you have set up for random thoughts, idea, or something you'd like to take a further look at later.

The only downside I have about OneNote is that it's not the best for clipping web articles. Sure it's nice to be able to save links, but I believe it's best to be able to clip the entire article into OneNote. That way you won't be dependent on if that article or even the site is still available. For web clippings I do use Evernote and their web clipper. Hopefully in a future update this can be done straight through OneNote itself.

If you want to get more organized with your notes or random findings, I suggest giving OneNote a try. Who knows, you may find it as useful as I do.

Using PowerShell to Help Debug Third Party Dependencies

I hate when an application has a third party dependency (web service, url, ftp, etc.) mainly because it’s hard to test or even see what data you’re getting back. However, this is one awesome reason to love PowerShell. PowerShell can be used to make those calls manually so you can see what comes back and, if needed, use that data further while doing tests. For example, you have a call that gives XML has a response and use PowerShell to traverse the response using the new Invoke-WebRequest cmdlet in PowerShell v3. I’ll use the MSDN blog RSS feed as a small example here.

However, PowerShell makes it easier for us to traverse the XML by putting all the nodes into properties. For that, we need to put the results into an XML typed variable.

And with the above we get these results:

image

image

And from there you can use the results anyway you need to to help test and/or debug that part of your application. This recently just helped me out of a bit of a bind.

A Thought on Legacy Code

I’m quite sure that during one’s career as a software developer they may have the pleasure of maintaining legacy code. Of course, I personally define legacy code as a project that has absolutely no tests. Most of the time, though, this may be a fairly old project. If that developer has been in the career at least a couple of years, then one of the first things they may say to themselves about this type of project is how bad the code and/or the design is. I, myself, have also done this quite a few times.

However, something has occurred to me while I was updating, not one, but three of these types of projects. Indeed, there’s code in these that I still wonder who in their right mind would have written. At this point I had a sort of an epiphany: this wasn’t a bad thing, this is what helps to make me a better developer. The main reason I believe this is that, since I actually enjoy writing unit tests, I concentrate on making the code testable and write as many tests as I can. Only then will I proceed to make the requested enhancement or fix. The project is actually better for that and you just did something that someone else deemed or was just flat out told that they didn’t have time or the energy to do.

In conclusion to this small rant, don’t always hate on having to update legacy code. It can be to your best benefit as a developer and what you learn from that can last quite a while in your development career.

Debugger Display using ToString()

One of the things as a .NET developer that I tend to do most while debugging is to traverse through objects and their properties to see what values they have. Of course, the Base Class Library has something to help us do this even faster and more efficient – DebuggerDisplay attribute. Let’s say you’re tasked to help an insurance company write an updated application to determine the rate based off certain attributes on the car, such as age and number of collisions. It may look something like the following:

Showing regular object debugging.

And while debugging you want to see the properties, Visual Studio will show you something similar to the below.  Not bad, but we can do a bit better with the DebuggerDisplay attribute. Let’s see how this gets used. With the same class definition that we had earlier, we just add the DebuggerDisplay attribute to the class. To access any of the properties, just enclose them in “{ }”.

And our result is the below. Note that you can still expand out the object for other properties as well.

Debugging the object with DebuggerDisplay

Now, this alone can help out, but we can also run methods in the DebuggerDisplay attribute. Let’s override our ToString method of our class and use that. Note that the “nq” in the attribute is for “no quote” which will remove the quotes from the resulting string.

And, as you can see, we get the ToString() result in our debugger tool tip.

Debugging object using DebuggerDisplay with ToString()

Of course, there are other reasons why you would want to override the ToString method in your own classes, but hopefully now you know just one more way you can use it. Have fun debugging, everyone!