Tuesday, July 03, 2007

VSX - First Impressions



# 

You only get one chance to make a first impression.  I want to record mine regarding VSX before I get too familiar with it.

First, the documentation and comments in the project template are very thorough and helpful.  If the legacy systems I've supported in my career were half as well documented, I'd probably be less obsessed with TDD these days.

Speaking of TDD, there is a great set of sample projects in the SDK.  These are found in %VSSDK_InstallDir%\%Version_Number%\VisualStudioIntegration\Samples\IDE\CSharp\.  In that folder, there are some reference projects, each of which include a TDD\ folder with unit tests.  Sweet!

So, kudos to the VSX team for the good documentation and the unit tests, on to what was less than stellar.  There must be a way to abstract the CTC file.  It isn't poorly formatted for a config file, but It could be so much better.  XML anyone?  I know XML takes it's lumps when it is used for scripting, or as a data serialization format, but it is ideal for a config file.

At the very least, there needs to be a CTC Editor GUI tool to prevent me from fat fingering some comma separated value.  Here is an excerpt from the tutorial:

This line contains comma-delimited fields. The first field is the command that will receive the key binding. This field is in the form GUID:ID, where the first part is the GUID for the package, which is defined in Guids.h (also in the CtcComponents folder). The second half is the command identifier you typed in when you ran the wizard; this identifier is defined in CommandIds.h (which is also in the CtcComponents folder).

The second field is a GUID representing where this keyboard shortcut will be available. Different parts of Visual Studio can have different keyboard handlers. For example, when you are inside a text editor, the keyboard shortcut CTRL+I runs the Incremental Search command. But when the Solution Explorer is active, CTRL+I has no key binding. Thus, CTRL+I is only available to the text editor.

We want our keyboard shortcut to be available everywhere in Visual Studio; thus, it will be global. For global keyboard shortcuts, we use the GUID defined by guidVSStd97.

The third field is not presently used; for now, you use the same identifier from the second field, guidVSStd97.

The fourth and final field is the keyboard shortcut. This takes the format 'character':otherkeys, where the character for the shortcut goes in single-quotes. The otherkeys portion represents SHIFT, CTRL, and ALT with the letters S, C, and A, respectively. In this sample we're using CS, which means CTRL and SHIFT. The letter used in this example is M; thus, this keyboard shortcut is CTRL+SHIFT+M.

Couldn't I have an editor that allows me to select values from lists, rather than manually locating them in guids.h?  This is "hold your mouth right" programming.  How am I supposed to remember that the third field isn't used, and why do we put in a value if it isn't used?  How about creating an enum that I can access in code, rather than making me remember the constant guidVSStd97?  How long can I continue with these rhetorical questions?  Seriously, this aspect of VSX screams for better tooling.  Perhaps this is what VSSDK Assist does.

Finally, I have a real issue with the PLK.  It is a bottleneck to community development to request a new key for every dll.  Perhaps we could have one key for all community created packages, while commercial vendors are required to have unique keys.

If I sound negative, it's only because I know I will become accustomed to these annoyances in my quest to master VSX, and I want to record them to remind myself what it was like to be a noob. :-)

Cheers,

++Alan

 Monday, July 02, 2007

VSX - Know Your Tool



# 

If you've ever read The Pragmatic Programmer, and you should, it makes a mantra of DRY (don't repeat yourself).  The point is that you have enough to do developing good software.  Don't waste time on repetitive tasks.  I apply the same principle to DRY that I apply to OOP.  If I see the same scenario in code three times, I abstract it into a class.  So, if I have to perform some boring, or at least repetitive, task three times, I automate it.  Well, that's the plan anyway.

This is my motivation for getting into VSX.  I don't want to perform the grunt work involved in creating Model View Presenter designs.  I want to focus on the interesting job.  It is the what, not the how that is difficult to get right in software development.  I hope to build some tools that allow me, and my fellow developers, to focus on the interesting work.

I decided to begin my investigation with the Visual Studio Extensibility QuickStart Tutorials.  These six labs promise step-by-step introductions to the various forms of VS extensions.  Below are my notes, so you can follow along from home.


In order automate tasks at a fine grained level in VS, you'll want to use the Managed Package Framework (MPF).  This is a managed API introduced in Visual Studio 2005.  Classes in the MPF are found primarily in the Microsoft.VisualStudio.Package and Microsoft.VisualStudio.Shell namespaces.  In order to manipulate the MPF, you interact with numerous interfaces.  You will implement many of these IVs* interfaces in your classes, so that VS knows how to interact with your package.

The primary elements available for creation are tool windows, document windows and commands.  In the new VSPackage wizard, the options are listed as Menu Command, Tool Window and Custom Editor.  Commands display visually as buttons on menus and toolbars.  Commands are also available in the command window by category.  Type "build." in the command window, and intellisense lists the commands available in the build category.

It can be useful to bind a keystroke to your custom commands.  The comments in the template for VS commands warn:

Notice that Visual Studio has a lot of components and commands, so it can be difficult to find a key binding not used by somebody else; if the key bindings are conflicting only one will be used and one problem is that the shell will not inform the user that a conflict was found. The only  way to detect the problem is to start Visual Studio under debugger, try to execute any command and look if there is a message in the output window about a duplicated accelerator found.

In order to distribute your package, you must request a Package Load Key from the VSIP site.  This is an unnecessary hassle, it seems to me.  I've requested a PLK for the package I created following the tutorials.  I understand the need to track commercial packages which extend the VS shell, but it seems like overkill for personal extensions.


It's 11:30, and I've only finished the second tutorial.  I'll pick this up again tomorrow.

Cheers,

++Alan

Going Deep with VSX



# 

I'm taking some time off around the Independence Day holiday this week.  I have several projects queued up for attention.  One that has priority for me is an investigation of VSX.  I was introduced to the latest efforts by Don and Ken while I was at TechEd.  I don't have much to report yet, but I would like to share some resources that I'll be exploring:

That ought to keep me busy for a few days!  I've got some ideas that I would like to implement in the IDE, but I don't know how to get started as yet.  I'll report back when I've learned something.

Cheers,

++Alan

 Thursday, June 28, 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

 Monday, June 25, 2007

My Birthday is Overdue?



# 

Upon logging in at the office this morning, I was greeted with an Outlook reminder that Alan Stevens' Birthday is two days overdue.  Perish the thought!  My birthday is a commitment I always keep. :-)

Wally completed another circle of the sun yesterday.  Cheers mate!

++Alan

 Wednesday, June 13, 2007

What's Your Programmer Personality Type?



# 

I can't get enough of these dumb online personality tests:

DHTC

You're a Doer.
You are very quick at getting tasks done. You believe the outcome is the most important part of a task and the faster you can reach that outcome the better. After all, time is money.
You like coding at a High level.
The world is made up of objects and components, you should create your programs in the same way.
You work best in a Team.
A good group is better than the sum of it's parts. The only thing better than a genius programmer is a cohesive group of genius programmers.
You are a Conservative programmer.
The less code you write, the less chance there is of it containing a bug. You write short and to the point code that gets the job done efficiently.

Now it's your turn to take the Programmer Personality Test.

Cheers,

++Alan

 Sunday, June 10, 2007

Tech Ed 2007 Day 5



# 

By the last day of Tech Ed, I am exhausted.  Many people have already left, and the ones that remain are often burned out.  The only reason any of us attend day 5 is that there are always awesome sessions saved for the last day.

I spent the morning in the Dev Lounge, trying to blog, but mostly talking to people.  My first session was the Birds of a Feather that Shawn and I were moderating.  On the way to the session, I ran into Don Demsak and invited him to join the discussion.  Don came, and added many insights.

I was pleased with the interaction in our BOF.  Attendees seemed interested in the subject, and contributed frequently to the discussion.  Shawn had someone take notes, and we'll each post those on our respective blogs.

Douglas White, whom I had dinner with two nights previous, attended the BOF, and we continued discussing the topic through lunch.  After lunch I attended a talk on implementing CMMI with Team Foundation Server.  This was a niche topic, but I'm square in the middle of that niche.

I was totally conferenced out by this point.  I met up with Geff and Randall to say goodbye, and I went back to the room to catch up on some sleep.  I'll have some reflections on the week once I return to Knoxville.

Cheers,

++Alan

    Comments [0]

Tech Ed Day 4



# 

After picking Michele up at the airport and settling her into the room, I headed to the Convention Center for more interaction.  I didn't attend any sessions on Thursday.  Instead, I spent my time in the Technical Learning Center talking to people.

I had a very intense conversation with Tim Mallalie from the Entity framework team.  He helped me understand the difference between the Entity framework and the Entity Data Model.  As teh conversation proceeded, we got into a discussion of the tools support for the entity framework.  He reported that they will have limited tooling at release in April, but they will have an extensibility model to encourage third parties to begin building tools and utilities to work with the EF and EDM.

I let Tim know about the conversations I had with Ken Levy about VSX, and offered to look into extending the EDM tooling options.  He seem very excited, and gave me his contact info, along with the contact in charge of the extensibility API.  After that, I talked to Ken about this development, and he asked me to get in touch with him once I had the VSX installed, and I was ready to work with it.

This is a very exciting development.  I think this could turn into a useful Codeplex project by the time the entity framework ships in April 2008.  Watch this space for further developments.

Thursday evening is always the big conference party.  This year, I was able to bring Michele with me, and we both enjoyed it very much. 

Adios,

++Alan

    Comments [0]
 Friday, June 08, 2007

Tech Ed Day 3



# 

Wednesday was exciting and choc full-o-goodness.  I spent a lot of time talking to people inside Microsoft.  If you've never been to Tech Ed, you may not appreciate how valuable this interaction is.  There are representatives of every team inside Microsoft standing around for the sole purpose of interacting with customers.  This is a terrific opportunity to find out about features and technologies you may be interested in. 

I attended one breakout session on test driven development.  It was the best session I've seen this week, and I will be sharing the slide with my peers when I return to the office.  This is a difficult practice to sell to people with little experience.  There were some good examples used to explains the benefits of a TDD approach.

At lunch, I had a great discussion with Noah Coad and Abhijit Rao about encouraging change at the developer level.  We agreed that developers must experience the pain of suboptimal practices before we embrace best practices. 

Back in the developer area, I sat down with Sam Guckenheimer to discuss organizational change around development process.  Sam said that most decisions to pursue CMMI or ISO process certification are motivated by the desire to pursue business opportunities that require those credentials.  This correlates with my experience.

Sam agreed that this is not a technological problem, but an organizational change issue.  Sam recommended the book Leading Change for guidance in implementing change at that level.  I'll most likely constrain my efforts to developer practices, but it's good to know about the resources.

I took a few minutes to visit with Bill Vaughn at the SQL CE booth.  I didn't realize that CE could be hosted in an ASP.NET session.  Bill asked why I might want to do that.  My reply is that my blog runs on flat xml files currently, and SQL CE would handle more performance and scalability than this solution, while maintaining the xCopy flexibility.

I spent some more time configuring my laptop, and a VPC to demo some tools for Ken Levy. I had a problem forming a network connection between the laptop and the running vpc image.  After fooling with it for a few minutes, I realized I could get expert help.  I found the VPC kiosk, and a MVP there, got me straightened out.

Once I had things running, I found Ken Levy and demoed my extensions to the Visual FoxPro IDE to connect to Team Foundation Server.  I showed the Version control tool I built for my employer.  Ken understood this tool immediately.  Next I showed the work item editing control I built using the Windows Forms Interop Toolkit.  Ken wasn't familiar with the toolkit, and it took a minute for him to see what I was doing, and what the potential uses are for the interop user control.

Ken then called his boss and Amanda Silver, a PM for Visual Basic, over to show them the potentials for this toolkit.  Ken then jumped into brainstorming about how to render WPF inside this control.  Next, we talked about how to provide tools for VFP developers to move to .NET.  We agreed that I could use the VSX tools to build some familiar tools in Visual Studio, so that Fox developers can get up to speed faster.  This conversation was probably the climax of Tech Ed for me.

Next I sought out the Entity Framework team.  I met with a couple of PMs and grilled them on the features, and future extensibility.  I'm pleased to report that we were all on the same page.  They have an excellent mapping solution, and planned integration with synchronization services and reporting services.

Before I left, I stopped by the WPF stand.  I asked Rob Relyea about hosting WPF inside a winforms user control.  I learned about the ElementHost and ControlHost.  Next, I asked about generating dynamic XAML and rendering it at runtime.  The answer lies in XamlReader.Load().  I also saw part of the "Booyah" video from MIX.  This is exciting because I can generate dyanmic XAML in VFP and render it inside of an Interop User Control.  I look forward to sharing this at Southwest Fox.

With my head full of exciting possibilities, I left the convention center to prepare for the Microsoft Influencers Party.  This party is a way Microsoft acknowledges people who promote their technologies in the community.  This includes user group leaders like me.

I wanted to visit the Corona Cigar Co. and get a nice smoke for the evening.  I found the most amazing cigar store/wine bar that I have ever seen.  I picked up a few smokes, and made plans to return on Friday.

The party was at Margaritaville, and it was packed.  I had dinner with Douglas White and Bill Vaughan.  We had a good time shouting our conversation over the sound of the live band.  :-)

After dinner, I made my way out to the patio to enjoy my cigar.  There I ran into Dustin Campbell, whom I met at last evening's flying adventure.  We had a great time smoking cigars while discussing agile practices and functional programming until they closed the upstairs including the patio.

The evening carried on at the Red Coconut where I enjoyed the company of Keith Elder, whom I had never met before.  There were many others there including Peter DeBetta,  Paul Ballard, Cory Smith and many others. I hung out far too late, and I paid for it the next morning.

Cheers,

++Alan

    Comments [5]
 Wednesday, June 06, 2007

Tech Ed 2007 Day 2



# 

Tuesday started with a good conversation with a member of the SQL Server Replication Services team over breakfast.  I love sitting down at a table with someone in a blue Microsoft shirt and asking what they work on. 

I was too late to bother with the first session of the day, so I headed over to the Hands on Labs.  I started a session on the new Acropolis application framework.  This was a totally new technology to me, so I spent most my time reading the manual.  I saved my partial session for later resumption.

There were lots of great sessions to choose from, but I settled on Joel Semeniuk's "Best Practices for Team-Based Software Development."  Joel is an excellent speaker with lots of great insight to share on this topic.  The room was packed, and I sat on the floor, but it was worth it.  I'll be sharing the slides from this session as soon as I return to the office.

I grabbed my lunch in a take-out box, and headed to a Birds of a Feather sessions called "Exiting the Zone of Pain: Static Analysis with NDepend."  This was an interesting discussion on a topic I was familiar with, code profiling metrics, and a tool I was not familiar with. 

It was during this lunch session that I bumped into Cam Soper for, at least, the fourth time.  It's obvious that Cam has excellent taste in parties and sessions. :-)  This time, we finally exchanged business cards.

I tried to attend Joel's interactive discussion after lunch, but it was packed again.  My Acropolis session from the morning took too long to resume, so I took the opportunity to work on a Hands On Lab on WPF.  I completed a couple of exercises, and enjoyed getting more familiar with the new GUI coding model.  I'll do more later.

For my last session, I attended "Developing Data Driven Applications Using the New Dynamic Data Controls in ASP.NET", but I left just as it got started to deal with a weird technical difficulty.  I'll find out more about these new controls later.  They look very interesting.

Shortly after lunch, I ran into Ken Levy, who has changed teams once again.  He is now doing community development for Visual Studio extensibility.  I promised to stop by later in the week to show him some extensibility I've been doing to bring VS features into VFP, and get his feedback.

In thinking about doing this demo, I realized that I didn't have the Team Foundation Server client installed on my laptop.  While I was sitting in afternoon sessions, I downloaded the client from Codeplex, and grabbed an ISO extractor from a Google search.  I extracted the image and tried to install, but I kept running into missing files.  I downloaded the 180 trial of TFS and performed the same routine with similar results. 

After fighting the issue for half an hour, I realized that the people who wrote the installer were standing 50 feet away.  I went over and asked for help, and received lots of it.  In the end, it was Chris Menegay who determined that the ISO extractor I used, WinISO, was chocking on path lengths over a certain point, and couldn't even read the files to extract them. 

I felt humbled, but grateful to get back on track.  When I got back to my room, later that night, I downloaded WinRar, extracted and installed without problems.  Moral:  don't download unknown software you find on Google. 

Once Chris identified my problem, he and I headed off to meet up with the rest of the Central Region group for our party.  Drew Robbins put together a cool event at the Skyventure Orlando indoor skydiving attraction.  I had never done anything like this before, and it was a blast.  I couldn't stop grinning.

 

What will tomorrow bring?

++Alan