This blog has, IMO, some great resources. Unfortunately, some of those resources are becoming less relevant. I'm still blogging, learning tech and helping others...please find me at my new home on http://www.jameschambers.com/.

Thursday, December 24, 2009

Visual Studio 2010 Wishlist

It’s Christmas and so here’s a short list of things that I am asking Santa to bring me for Christmas (or in the March CTP) for the next build of Visual Studio 2010.

More Collapsible Regions

I would think this one would be easy enough because there is an implementation built in at a higher level.  Let’s also have the ability to collapse whiles, ifs, foreaches, switches and the like.

Collapsible Selections

I would like to be able to highlight a block of code and have that highlight turn into a collapsible region.  We are given collapsibles on certain blocks of functionality (methods, classes, comment regions) and if my first wish is granted than on other constructs as well, but not on selections.

While this is good:

image

…allowing me to collapse this would be even better:

image

…and by putting a image in the margin the team should be able to use the existing functionality they’ve implemented.

Intelligent Collapsible Regions – With Style!

Okay, so what if we could get those selections and regions collapsed?  We’d also like a way to preview those hidden bits, right?

Thankfully the editor is written in WPF now, so this shouldn’t be much more work than creating adorners for the collapsed hints.

And while they’re already doing it to some level (hover over the ellipses on a collapsed region) it is grey, without syntax highlighting and in a non-fixed-width font.  Let’s jazz it up.  In fact, let’s have two views: the first would reveal comments in the /// style and then an expander would animate open to reveal a little code browser.

There has got to be an intern working on the IDE team that could use a project like this as a learning experience ;o)

Code Browsing

Since we’re talking browsing, let’s hit my last item on the list for today: an alternative way to browse code.

If you don’t write them yourself, you likely work with someone who does: long code files.  I have a big monitor, so I am able to fit about 55 lines of code onscreen at a time.  But many of the classes I work in are 200+ lines of code (especially any DAL work). 

Other scenarios where traditional code browsing techniques break down are in tool-generated code.  When you’re looking through a LINQ to SQL generated class there can be literally thousands of lines of code.

Getting your head around ‘where’ you are in the file is not easy to do.

But what if you had a thumbnail view of the code?  That thumbnail could have highlighting for keys that you select in the legend. As you hover over the miniature version of the class, you get tooltips that reveal method names or a preview of a comment.  Clicking on the ‘map’ would take you to that place in your code.

There are about 100 different things you could implement in that, some of which would even be useful.

Or a Lump of Coal

image Visual Studio 2010 (I’m on Beta 2 as I write this) is loaded with treats and it runs fast…and the IDE team has already promised better performance in the next build we see.  If all I got for Christmas (even if it was a late gift) was a release copy of VS2010 I’d be a happy kid.

The .NET Framework 4.0 is a game-changer, and you’ll need Visual Studio 2010 to get in the game.  As the various parts of IDE continue to evolve, things like browsing code or manipulating the view of your code will become more and more integrated with your flow of development.

And when you see the above features show up, you can send me a Christmas Card. ;o)

Merry Christmas to everyone.  May you be blessed with the Joy, Peace, Love and Hope that this season was intended to bring.

Wednesday, December 23, 2009

Getting Started with Workflow Foundation 4.0

I am working in Visual Studio 2010 Beta 2 with Windows Workflow Foundation 4.0.  Generally speaking, it is a little easier to get around, the designer is more straightforward, the samples are fairly complete but documentation is lacking in some areas.

There is also very little by way of best practices, and I haven’t fully explored the pros/cons of the samples that Microsoft has put forward, but I am working through them and trying to get my head around this space.

Here are some sites that can help you get started:

WCF and WF Samples for .NET Framework 4.0 Beta 2

MSDN Discussion Forums for Workflow Foundation Beta 2

The Problem Solver blog on persistence and other things WF

I highly recommend the samples if you’re interested in WF; if you’re running Visual Studio 2010 they all load/compile relatively easily and some of the examples are fairly comprehensive.

As a tip, make sure you compile the application prior to loading the WF designers in the samples.  I have crashed VS.NET’s designer and hung the IDE once so far by trying to drill in prior to compilation.

Monday, December 21, 2009

A Really Useful Search

Raven’s web-based administration and CRM module got a big upgrade in its search capabilities with last Friday’s build.  For reasons of simplicity and time-to-integrate, the first builds’ search capabilities were based off the legacy application’s model of defaulting to a customer name search and using a combo box to change what you’re searching “against”.

Searching for Business Return

The first implementation wasn’t without its smarts, however; I built in some metrics to determine what users were actually searching on and discovered that last name searches were only used about 10% of the time, and of all the fields used to search against (27), there are really only 8 things people use to find customers (and Account Number would have been a better default).

I took those results and went to speak with the users about their search experience.  It turns out that most of these search techniques were learned because of how they found customers in the legacy system.  Depending on what you were going to search for, you could be as many as 8 clicks away from a customer record in that app, so they have even mentally trained themselves to pattern searches in the easiest way the software works, not necessarily what they have for information at hand.

Also, for the most part, there was a common problem with how they searched for things and where they had to go to do so.  Rather than focusing on the task the user would try to execute on a daily basis, the software was organized into groups of data that were related on the database.  The search for customer was in a different spot than the search for a tower.  Could you imagine if Google had a different page for each search topic?  Beyond that, the summary information returned from the search was only useful to confirm the result was what the user was looking for; users had to drill into multiple results and then back out if they didn’t find what they were looking for.

Goals for Improving Enterprise Search

There were three major things I wanted to accomplish:

  1. Infer the search type based on the user’s input.
  2. Increase the relevancy of the information returned.
  3. Provide search access from anywhere in the application.

I’ll start with three.  It was the last thing on the stack.  ;o)

I took a bit of a shortcut on number three and have spent the least amount of time on it, but it is still an improvement over the legacy system.  All I’ve done here to-date is incorporate a dashboard system and an easy way to get back to the dashboard from anywhere in the system.  At the top of the dashboard is the search bar, which has focus on page load.  Users are now two clicks away from seeing their search results from anywhere in the application.

Popping off the stack, we’ll discuss number two next: search result summary.  I have to admit on this one I’ve taken a bit of a cue from the major search engines.  You know how if Bing thinks you’re looking for videos, it will show you a few videos?  Or if you search for something that seems like an image on the main Google search, it will show you a few image results?  Well, I took a bit of that approach.  If a user is searching for a tower, they don’t need to see a phone number or street address, they want to see number of customers on that tower, and the status of that tower.  Likewise, if they are searching for a customer, there are certain pieces of information that are more relevant to the user. 

I even took that one step further, because the role of the user influences the styling and information contained in the search result.  For example, an account manager is likely looking for contact information and contract details, whereas a help desk technician is looking for recent tickets and the current status of a customer’s connection.

That accomplished, I needed to tackle number one on the list: inferred search type.

This turned out to be a lot easier than I was expecting.  I have written a series of regex expressions to identify the kind of search a user is performing and compiled them to a DLL.  I pass the search string into a method which returns the appropriate search provider and takes care of building queries, LINQ to SQL or calls to stored procs (depending on the system I am accessing).

To tie one and two together, I use the search provider to return a function mapped back to a controller, which then executes the appropriate build and bind sequence for the result list.  This is done through AJAX/jQuery and the MVC framework.

Acceptance?

It’s different.  It isn’t what people have been using for the last eight years, so I expect some friction. But a big positive is that everyone agrees it’s faster and I’m getting all kinds of suggestions for things to add, which means they’re using it (and are interested enough to see it move forward)!

For the time being, the legacy application is still the workhorse in the enterprise, but I’ve now created a bridge from Raven into that system.  What users have now is the ability to search much more quickly and then use the bridge to link into the old system, hopefully that doesn’t prove to be a pain and over the long term it helps the users transition into Raven.

Friday, December 18, 2009

Easy Fix for Visual Studio 2010 Beta 1 Uninstall Problems

I had downloaded and installed Visual Studio 2010 and I’m pretty sure I do so via the web installer from MSDN Subscriber downloads.

As you can expect with beta software, it’s likely that there will be crumbs left all over the place while a vendor works out the kinks in the deployment/installation experience.

I had one laptop left that I hadn’t updated at home, and so moving to Visual Studio Beta 2 was tonight’s project.

Insert Disk to Continue

The uninstaller was looking for the EXE used to install “Microsoft Team Foundation Server 2010 Beta 1 Object Model”. Of course, if I used the web installer – which I think I did – I never would have had a disk.

On a different, unrelated issue, I found uninstall instructions for Visual Studio 2010 Beta 1 here.

I actually started the first step, fired up my screen cap to show that it was indeed working, and before the snipping tool kicked in the uninstall was actually complete.

So, here’s a gratuitous shot of the snipping tool in Windows 7:

image

If you didn’t uninstall the TFS Components first, you would have seen them in this list:

image

There are quite a few posts and random tidbits about machines becoming unstable with botched VS 2010 uninstalls.  I’m glad I ran into a snag before I got myself into trouble.

UPDATE: If you’re interested, the order of instructions worked flawlessly and Beta 2 is now getting installed.

Visual Studio 2010 Release Date Delayed

I think this is a really good call by the folks at Microsoft.  There was a huge jump in performance from Beta 1 to Beta 2, which I think allowed people to believe their feedback was being heard, thus making them comfortable giving more feedback.

The releases are here:

http://weblogs.asp.net/scottgu/archive/2009/12/17/visual-studio-2010-and-net-4-0-update.aspx

http://blogs.msdn.com/somasegar/archive/2009/12/17/visual-studio-2010-and-net-framework-4-beta-period-extended.aspx

Feedback Loop

As someone who has been actively participating in the Visual Studio 2010 Beta cycle, I can certainly vouch for their comments about listening to the users.

When I pushed a performance issue to a Microsoft-er, he wrangled in two other folks to help figure out where the problem would be.  We went back and forth for two weeks to identify and rule out some issues, then they got me to do a couple of performance profiles and send them in via secure upload site.

By the end of the process there were seven or eight Microsoft employees participating in the email chain and recommending different configuration settings, suggesting workarounds and requesting information about usage on the product.

A Different Microsoft

I entered my career in the development world as a snot-nosed teen, lovin’ Torvalds and putting the big hate on for “Micro$oft”.  I started to tinker with the first bits released for .Net and quickly got hooked. 

I understood and believed many of the criticisms of Microsoft in the 90’s, but the company has changed.  The way that they responded to my performance concerns in Visual Studio 2010 shows a level of commitment that I have not seen with anyone I pay money too; not my vehicle manufacturer, not the builder of my house, not any of my household appliances.  Call Apple and ask them to fix something on your iPod and see how far you get.

If you complain about the things you don’t like about Microsoft and you haven’t given them a chance to fix them, you have to drop the chip on your shoulder and get involved in the beta cycles.  I’m using VS2010 daily, sending emails, participating in forums, submitting feedback and blogging about things I’d like to see. 

Heck, I’m a programmer and Visual Studio 2010 was my idea.

;o)

Wednesday, December 16, 2009

VS 2010 – Validation Warnings in ASP.NET

I was getting a whole host of errors on even the simplest of web pages or components (aspx or ascx) in Visual Studio 2010 Beta 2.

Validation (): Element 'content' is not supported.

…or…

Validation ($SCHEMA$): Element 'div' is not supported.

…and others.  Basically, all ASP.NET controls and all HTML tags were not validating.  Here’s a shot from a simple page with about 30 controls on it:

image

The Perils of First Place

It turns out that there was a bug with the user settings from earlier betas of Visual Studio 2010.  When you are an early adopter you sometimes have to eat the weird situations of non-workingness.  Removing the older IDE would leave behind some zombies that attacked the recognition abilities of Beta 2, thus generating loads of validation warnings.

The webdevtools folks published an article on this which helps.  They don’t mention the zombies, but I’m pretty sure they are there.

To get around the problem, simply run Tools –> Import and Export Settings and reset everything.  Unless you are particularly attached to something in your user settings don’t bother saving what you currently have.  It takes a few moments to reset the IDE…image

…and then you’re done.

image

Project Pinning in Visual Studio 2010

Visual Studio has in the past allowed us to set how many projects are displayed when we have a view of recent work.  In Visual Studio 2010, that feature is extended further with the ability to “pin” frequently used projects to our list.

The recent projects list is displayed in the Visual Studio start page, if you have that option turned on (it is by default.  If you have turned it off, you can restore the start page by navigating to Tools –> Options and then to the Environment –> Startup property page.

image

You get the thumbtack icon when you hover over a project item.  Click it to have it stick around. Below is hover state of an unpinned item.

image

Also, in the flavour of ‘handy’ is the ability to control how many items appear in the Recent Projects list.  I mentioned this earlier so here’s how to do that.  Above I have 6 showing, which is set under Tools –> Options in the Environment –> General property page.

image

I am fortunate enough to have a good sized monitor, so I like the ability to fill the white space on the Start Page with about a dozen or so recent projects. 

This Ain’t Your Daddy’s IDE

But then, chances are, there are few of us with Daddies who had IDEs.  But, I digress…

I’m using Visual Studio 2010 about 80% of the time right now, but still hanging on to 2008 for a couple of projects that aren’t playing nicely.  With simple, trivial but yet productive time-saving features like this and others, it’s been the easiest switch of IDEs for this 12 year vet to the industry.

Here are some other suggestions I had, including my first mention of Project Pinning.