Wednesday, 14 January 2009

Tools Still Matter

Last week, I facilitated the Open Spaces at the awesome CodeMash conference. The theme of the Open Spaces was “Techniques Not Tools.” While I certainly agree with the sentiment, I still believe tools matter.

In my professional development, I work in .NET 1.1 using Visual Studio 2003 and I assure you there are limitations imposed by the tools. I am still able to build software that I am proud of, but it could be easier.

I’m currently setting up a new development VM and I thought I would share the configuration settings I use. I start by installing Visual Studio Team System 2008 Development Edition. I probably don’t need anything more than the Professional Edition, but there are some tools in the Development Edition that have been useful in the past.

I immediately install SP1 before I even launch Visual Studio. Once I launch VS, I choose C# developer settings. After the incredibly long wait, the UI appears and I make my way straight to Tools –> Options.

image

Under Environment/General, I uncheck animate environment tools.

image

Next, under Environment/Startup I select “Show empty environment.”

image 

Under Projects and Solutions/General, I set the “Visual Studio Projects Location” to C:\Development.

image 

Next I go to Text Editor/All Languages/General and turn on Auto List Members, turn off Hide Advanced Members and turn on Parameter Information. I also turn on Line Numbers and turn off Navigation Bar.

image

In Text Editor/All Languages/Tabs I set indenting to Smart, Tab Size and Indent Size to 2 and select Insert Spaces.

After closing out of the options dialog, I go to Tools-> Import and Export Settings where I import Brad Wilson’s Dark Consolas theme for VS2008. I will frequently tweak the font size depending on whether I am doing a presentation, but in general, I use the defaults from Brad’s settings file.

Now it is time to close Visual Studio and install Tortoise SVN and reboot. After the reboot, I install Visual SVN and Resharper. Both of these tools cost extra and both are more than worth the money. Because I don’t do any commercial development on this VM, I could install the personal edition of TestDriven.NET, but I have found that I get value from the emotional reinforcement of watching the green line grow in the Resharper Test Runner.

The last step in setting up a clean Visual Studio Install is to launch the IDE, go to View –> Toolbars and turn off all the toolbars. You will have to do this multiple times because different toolbars are active at different times. You do not need toolbars, and they are probably slowing you down. Learn the keystrokes. You will be a more productive developer as a result.

Finishing up, I install the Web Deployment Projects, Power Commands and the VS Command Shell extensions. Finally, I close the toolbox because every time I accidentally mouse over the damn thing, it slows me down. ;-)

Productively,

++Alan

 Thursday, 06 December 2007

Getting Started With TDD in Visual Studio

I've given talks on doing test-driven development (TDD), and I've had lots of conversations with other developers interested in giving it a try.  What I've found is that the simple setup and configuration hurdle is intimidating to most people at the start.  In this entry, I intend to remove that initial hurdle (and excuse).

The professional version of Visual Studio 2008 now includes MSTest unit testing framework.  I've been working with MSTest since the release of Visual Studio 2005 Team Developer Edition.  If you want to get started doing TDD in Visual Studio, I recommend you get the Professional version of VS2008 and learn MSTest.  I'm not recommending MSTest over any other unit testing framework.  I am asserting that the easiest way to get started is to use an integrated tool.

Unfortunately, purchasing the latest and greatest from Microsoft is too large a commitment for many people coming to TDD or Visual Studio for the first time.  I believe that TDD is essential, and I want to remove as many barriers as I can for people interested in implementing TDD in their development practice.  To that end, I have created project and item templates which enable a simple TDD workflow using the FREE NUnit testing framework and the FREE Visual Studio 2008 Express editions.

It should be noted at the start that I could use some VSX-fu to enable even more automation in the standard edition of VS2008, but the license expressly forbids the use of VSX APIs in the express editions of Visual Studio.  If you already have the standard edition of VS2008, or the standard or professional editions of VS2005, check out testdriven.net for seamless integration of NUnit, and several other unit testing frameworks, with Visual Studio.  For this discussion, however, we will stick with templates to avoid angering the "powers that be" in Redmond.  That being said, the templates and instructions for their use should work as advertised in any version of Visual Studio 2005 or 2008.

You will need to download and install the express edition of Visual C# (or Visual Basic) from here.  Next download this version of the NUnit framework and install it into the default location.  The references and paths in the project and item templates are specific to the 2.4.3 version of NUnit.  Finally, you will need to grab my templates and extract them.

There are four templates which are zip files, so don't extract them individually.  There is a project template and a new item template each for C# and Visual Basic.  I will be using the C# templates for this walkthrough, but everything here applies equally to VB.

You will need to manually copy the templates to the appropriate folders.  Typically user templates reside somewhere under Documents/My Documents.  You can verify the location by opening Visual C# Express Edition, selecting the tools menu, then the options pad.  In the resulting dialog, check show all settings in the bottom left corner.  You should now be able to select the Projects and Solutions node in the treeview.  This will display the current locations for item templates and project templates.

Once you know the proper template locations, copy NUnit Test Project - CS.zip to the project template location and NUnit Test Fixture - CS.zip to the item template location.  If you have touched all the bases to this point, you should see the new project template option when you select the file menu and click the New Project pad.

Select the NUnit Tests template under My Templates, give the project a name and click OK.  After the generation process is complete, press F5.  After a brief pause for compilation, the NUnit form should display and run the tests.  You can then enjoy watching the default tests happily fail.  Close the NUnit form to return to the IDE.

If you open the <projectname>.cs file, you will see a test fixture (class) with three default test methods included.  You can add as many tests as you want to this class, but you will probably want to group your tests into separate classes.  When you want to add another test fixture, simply right-click on the project and select add -> new item.  You will most likely have to scroll to the bottom of the item templates list to find the NUnit Test Fixture listed under my templates.

I like having my tests run on every compile, but you may want more options.  If you add a new NUnit test project to an existing solution, you will need to configure the solution for it to launch the NUnit GUI as the default start action.  Alternately, you can configure the solution to launch the currently selected project.  Right-click the solution in Solution Explorer and choose properties.  There you can select the Unit Test project if you want a single startup project.  You can choose the Current selection to have more control, or you can choose the multiple startup projects option, if you are feeling especially frisky.

If you have made it this far, then you have everything you need to practice TDD in Visual Studio.  From here, I recommend you get familiar with NUnit by reading their documentation.  Next, you should learn more about TDD and how to be effective with it.  I have compiled some extensive bookmarks for your convenience.

I hope this tutorial has helped eliminate your concerns and alibis over taking the TDD plunge.  I want to make it as simple as I can for interested developers to get started.  If you have any feedback or suggestions for this entry, please post it in the comments so that I can make this a "go to" reference for aspiring TDDers.

Cheers,

++Alan

 Saturday, 03 November 2007

What's Up at Windows Live?

I don't write blog posts from my desktop PC (or anywhere else, honestly) very often.  I wanted to make a post about some progress I made with the VSX, but I noticed I had an old beta of Windows Live Writer installed on this box.

I downloaded what appeared to be the installer for Live Writer here.  Upon download completion, I began the install only to be prompted to set my default home page and my default search provider to MSN and Live search respectively.  While I don't like an installation routine trying to change unrelated settings, I will credit the Live team for at least prompting me.  I won't install anything from Yahoo after they changed my home page and search provider without asking.

Moving on, I encountered a screen asking if I wanted to install additional software with all the boxes checked, of course.  I unselected the additional packages, and looked for a "next" button without success.  I tried cancel, but that wanted to exit the whole install.

I stared at the same dialog while it apparently checked to see if I had Messenger, Writer and Sign-in Assistant already installed.  I don't why it took so long to check, it obviously new they were installed because they weren't listed in the additional products section. 

This "Checking for installed products" went on for far too long.  Eventually the installation began, with an update to Messenger that I did not ask for, nor particularly want.  Why does Microsoft continue to insist that they have the right to install un-requested updates on my machine.  At least with the Microsoft Update site I can decline updates.

In the end I have the new version of Windows Live Writer that I wanted.  It "only" took 41 minutes to install!  What is up with that?  Who thought this would provide a good UX (user experience)?  WTF?!?!?

Grrrrr,

++Alan

[Update] It appears that I took issue with the install experience the last time I updated my Live Writer install.

 Friday, 19 October 2007

Uninstall U3 from Your Thumb Drive

I have a SanDisk cruzer thumb drive and I love it... except for one thing.  Whenever it is plugged into a new PC, it autoruns and installs an application called U3 without asking.

Fortunately, Rick Borup pointed me to the U3 uninstall tool.  You have to confirm you want the tool multiple times, but when they let you download the tool, it works as advertised.

 Thursday, 28 June 2007

Is LinkedIn Useful?

View Alan Stevens' profile on LinkedInYesterday, I responded to some requests for connections on LinkedIn.  I'm terribly lazy about this.  Both of these invites had languished in my inbox for over a week.

Once I logged into my account and accepted the invites, I began looking around for evidence of value.  I had a few connections with co-workers and people in the .NET community, but I couldn't see what good it had done me.

I added a link to my LinkedIn profile to this blog a while back during my blog renovations.  That allowed one person I met at Tech Ed to get in touch with me.   Because of that, I decided there may be value in this service.

I began searching all the connections of my connections, that I knew, and inviting them to connect directly to me.  I dug around for email address online of people I didn't have in my address book.  I added my address books from Outlook and Gmail, and invited anyone I thought might be interested.

On a roll, I installed the Outlook plugin for LinkedIn and had it search my archived mail for contacts. I have to admit that this became addictive.  I would send a batch of invites, and wait for email confirming that people had accepted.  I drooled like one of Pavlov's dogs every time I saw the blue toast in the corner of my screen.

This went on well into the evening.  I was very happy to get an email response from an old friend whom I hadn't seen in a few years.  We caught up.  I learned that he was in Memphis and engaged, while he learned about my marriage.  This was a very pleasant exchange, and one that I could have initiated with a simple email, but it resulted from inviting him to join my network.

This morning I moved on to collected business cards.  I was pretty bold by this point and I invited people whom I had barely been introduced to.  This surprised one person who asked how I got his email address!  I explained that I had interviewed for a job with him two years ago, and wanted to connect with him because he supervised many developers who might be interested in our user group.  He was pleased with this, and accepted the invitation.  He also asked me to send him information about the user group meetings, so he could distribute it to his employees.  Now, I was seeing some value.

I believe the best proof of value came when I connected with another user group leader I met at Tech Ed.  He responded to my invite by asking me to speak it their "Day of .NET" in November.  That was definitely a valuable connection.  Again, it was a circumstance that I could have initiated through simple email, but it happened by connecting on LinkedIn.

I still have a couple dozen invites pending.  I'm considering inviting all the regular attendees of the user group, so we can build a network for ETNUG on LinkedIn.  I'm also adding my LinkedIn profile to my email signature.  I'll report back in a month or so to let you know if any of this was worthwhile.  My fear is that LinkedIn is just another friendster dressed up to be appealing to us "professionals".

We shall see,

++Alan

 Friday, 01 June 2007

Follow My Web Browsing

I've been using Google Reader as my feed reader for six months.  Scoble uses his reader to create a link blog.  I've been using this feature for a while, and find it very useful.

If I see something interesting in my feeds, but I don't want to read it immediately, I can add it to my shared items, and read it at my leisure.  This is less formal than a bookmark.  Later, if I think the article is interesting enough, I can bookmark it.

Because these shared items are public, you can follow along with me.  There is also a feed, so you can track my feed reading in your feed reader.  Think of it as a recursive feed.  I've added the links to the navigation section at the right.

Enjoy,

++Alan

 Wednesday, 30 May 2007

Windows Live Writer Beta 2

Michael alerted me to the new version of Windows Live Writer this evening.  I just downloaded and installed Windows Live Writer Beta 2, and I'm happy to report that the installation file was not named setup.exe

The installation routine was unusual, however.  The setup wizard dialogs appeared in the bottom, right of my desktop.  I initially thought they were large windows running off the screen, but the were actually dialog sized windows, like you would expect to find centered on the screen.

I moved the first two windows in an attempt to see the whole thing, only to discover that I could already see the whole thing.  I'm pretty fed up with Microsoft usability guidance lately.  They appear to make up a new look and feel for every product setup and UI.  This attempt at innovation was probably intended to be less intrusive, but it was disconcerting in my experience.

In addition, why must MS attempt to reset my home page and search engine in Internet Explorer?  I like my home page and search engine, and they have nothing to do with the tool I'm trying to install.  At the very least, these options should be unchecked by default.

Anyway, if you're reading this, it works for me.

++Alan

 Tuesday, 07 November 2006

Free Directory Sync Software

A co-worker asked me yesterday if there is a way to use Kdiff3 to synchronize directories similar to BeyondCompare.  I briefly attempted this task in the recent past without success.  It turns out that it can be done, but I went on to look for dedicated file sync/backup software.  Here is a list of what I found:

Whew!  This is obviously a common user need.  I wonder why it isn't baked into the operating system, or if it is, why it isn't more easily discoverable.  I have not evaluated all of these (I've wasted enough time finding the links and making this post :-)), but I have launched all of them that do not require an install.

I'm currently using SyncBack to back up files between an external drive and my local disks.  It is polished, and meets my needs.  Feel free to try the others and post your experiences in the comments.

++Alan

 Thursday, 31 August 2006

Scott Hanselman Updates His Tool List

Check out all the goodies Scott has for us here:

Ultimate Developer and Power Users Tool List for Windows

I first saw Scott present at TechEd05 in Orlando, and asked him about some of the apps he used in his presentation.  My productivity has been improved ever since.

While his list is impressive and very comprehensive, I would make one addition and one substitution.

First the substitution, I'm not a fan of VLC.  I've tried it a few times after recommendations like Scott's, but nothing beats Media Player Classic in my experience.  Pair this lightweight media player with Real Alternative and QuickTime Alternative and you will realize a new level of simplicity in using online media.

My nomination for addition to Scott's list is GetPixel.  It is drop-dead simple.  It only does one thing, but it does it well.  The name says it all.  This tool gets the values of a selected pixel.  Very helpful for a GUI developer.

++Alan

 Thursday, 11 May 2006

Speed Up Your PowerShell

I've been having fun with the latest drop of PoSh.  I'll be showing a demo of how to manage workitems on Team Foundation Server with a PoSh script at Saturday's CodeCamp.

One annoyance with the current RC is that it is slow to start.  I saw a thread on the newsgroup about performance and found this nugget:

set-alias ngen C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe
ls $pshome/*.dll |%{ngen install $_.fullname }

The ngen utility compiles .NET assemblies to native code.  Without this step, the PoSh process was performing a JIT compile on all the PoSh assemblies.  Apparently, this is supposed to happen at the end of installation, but doesn't as a result of a bug.  For now, this makes my play... er, work with PoSh even more fun.

++Alan

 Wednesday, 26 April 2006

Windows PowerShell

According to this, PowerShell nee MSH nee Monad is on the verge of release.

This is exciting news for me because I spent this week learning the tool. I have had requests to make bulk updates to work items in Team Foundation Server. I decided to investigate MSH as a platform for creating custom scripts to fulfill this request.

Now that it is on the verge of release, I won't have to overcome resistance to deploying pre-release tools. Life is good.

++Alan

[UPDATE] Keith Hill suggests some new acronyms for the Windows PowerShell.  I vote for POSH.

"Oh the posh posh traveling life, the traveling life for me..."

 Thursday, 15 December 2005

Windows' DPI Setting

I spend my days looking at high resolution monitors; 1600x1200 at work and 1920x1200 at home. :-D  One suggestion I read for using high resolutions, is to bump up the DPI Setting in display properties from 96 to 120dpi.  This seemed like a good idea until I tried it.

All the title bars become too large and some applications can't cope with non-standard dpi settings.  I see enough bad formatting on the web. I don't need it on my desktop too, so I changed the setting back.  Unfortunately the window captions were still the wrong size.  I fixed this by going to Display Properties -> Appearance -> Advanced and playing with the title bar settings until things appeared normal.

This would seem to end this chapter in my battle with Windows(tm) except that I earn my living using two Integrated Development Environments: Visual FoxPro and Visual Studio.  Both IDEs make use of sub-windows with half-height captions.  After my DPI Setting experiment, these captions were twice as tall as they should be with complementary giant, blocky icons. :-P

I have put up with this situation for months, until today.  Today I found my limit in tolerating ugly displays and set about correcting the issue.  Unfortuanately, Google did not provide me any leads.  I find it unlikely that nobody else has had this problem.  Given my state of mind, I perceviered.

I set  about searching the registry for vaious keywords.  I eventually found the WindowMetrics key under Users\.Default.  I exported that key, edited the path, and imported it into the equivalent key in the CurrentUser node.  After a quick logoff/logon to reload the registry, Bob's your uncle!

The attached file should serve to correct this situation for any other users with this affliciton.  Change the extention from .reg.txt to .reg, double-click, select OK, and you'll be golden.

++Alan

WindowMetrics.reg.txt (4.4 KB)
 Wednesday, 14 December 2005

VSTS Virtual Labs


Register Now!

I got this link from our Microsoft Regional Developer Evangelist.  It looks interesting, but I haven't had a chance to try it out.  If you complete one of the labs, please let me know what you think in the comments.

++Alan
 Friday, 11 November 2005

Really Big Files on a CDR

Microsoft provides development releases early and often, now.  This is great because I get to see what's coming while it is being developed.  This is part of Microsoft's drive toward transparancy, and it is a good thing.  The problem is that I don't want to test these unstable releases on my work PC because, you know, I, like, make my living using that machine.  As a result, I want to install them at home, where it would be annoying if they broke something, but I could continue to pay the rent.

Seems simple, right?   I just take the file home and install it.  Well, that's the catch.  I can't just take the file home, because it is often a DVD image file, and I don't have a DVD burner at work.  (Incidently, I bought a dual layer burner for my home PC, but have you seen the price of dual layer media?)  Now along comes Jason with a terrific solution.  It's called Free File Splitter, and it is exactly what its name promises.  It's free and it splits files.  Not only that, but it provides a batch file to re-assemble the original file once all the fragments are copied to the hard drive.  Sweet! 


++Alan
 Wednesday, 09 November 2005

Totally Cool Firefox Extension

I have used the Image Zoom extension in Firefox for many months.  This week I downloaded an update using the friendly Firefox update feature.  It was only today that I "discovered" an exciting new feature.  If I hover my mouse over an image in Firefox and scroll the mouse wheel, the image zooms in or out depending on the direction I scroll. 

Totally cool!

++Alan