Do power toys have a place in the classroom?

Alfred thinks so, and I do too.  More on this later…

One of the biggest lessons i’ve learned from Rob @ WiX is that code is just an inanimate object.  You need to do something with the code to make it interesting.  For example (and this is just my example, so in case it sucks, don’t blame Rob) code is like a piece of paper you created from scratch.  Okay, that’s great, now what?  The piece of paper isn’t really all that interesting until you write on it or fold it to make origami figures (or share with others how to write on it or make animal creatures).  Same with code.  You give it life by coming up with a vision for it.  How do you want people to use it?  Why should they use it?  Is anything blocking them from using it?  This might be a weak analogy, but at least you get to learn about Shared Source with me.  =)

So, if you’re a student or faculty member, how could our Power Toys as Shared Source work for you?

Using the ClassName() snippet function – an operator declaration snippet example

A previous tip of the week mentioned how to use the SimpleTypeName() snippet function.  Here’s how to use the SimpleTypeName() function alongside the ClassName() function.  The ClassName() function will automatically substitute the name of the outer class. 

For example, if you had

class Class1

{

  

}

You could make a snippet that used the ClassName function to automatically generate

public static Class1 operator +(Class1 one, Class1 two)

{

   throw new System.NotImplementedException();

}

Here’s the snippet to make the operator declaration used above:

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

  <CodeSnippet Format="1.0.0">

    <Header>

      <Title>Addition operator</Title>

      <Shortcut>addop</Shortcut>

      <Description>Code snippet to create an addition operator for a class</Description>

      <Author>Microsoft Corporation</Author>

      <SnippetTypes>

        <SnippetType>Expansion</SnippetType>

      </SnippetTypes>

    </Header>

    <Snippet>

      <Declarations>

        <Literal Editable="false">

          <ID>EnclosingClass</ID>

            <Function>ClassName()</Function>

        </Literal>

        <Literal Editable="false">

          <ID>NotImplementedException</ID>

          <Function>SimpleTypeName(global::System.NotImplementedException)</Function>

        </Literal>                                             

      </Declarations>

      <Code Language="csharp"><![CDATA[

    public static $EnclosingClass$ operator +($EnclosingClass$ first, $EnclosingClass$ second)

    {

        throw new $NotImplementedException$("Method not yet implemented");

    }]]>

      </Code>

    </Snippet>

  </CodeSnippet>

</CodeSnippets>

Tags: VSTips
Suggest a Tip!

Getting more space between your variables and their declarations in C#

Let’s say you want to keep your formatting rules enabled, but want to get some additional space between your variables and their declarations. You can put a C-style inline comment in the whitespace between the two. For example,

class Class1

{

   int/**/ a = 1;

   int/**/ b = 2;

}

 

Note that you could do something like this, by adding the spaces after hitting the semicolon at the end.

int

a = 1;

 

However, if you ever format the document, format that selection, do something on that line to invoke formatting (like re-entering the semicolon), the line will go back to

int

a = 1;

 

Tags: VSTips
Suggest a Tip!

Interview on MainFunction

As I said in a previous post, I’m really behind on blogging.  Back in the March / April timeframe, I was interviewed by Pat Phillips, the Editor-in-Chief for Microsoft’s MainFunction, a website targeted at high school computer science professors.

On the site, you’ll find both a written interview and a NPR-style audio-interview.  Also, check out the list of previous interviewees.

They wanted me to focus more on blogging during the audio interview, but I got carried away for my love of Final Fantasy games.  (yes, the Final Fantasy VII DVD is AWESOME!!)  One of these days I’ll write down my vision of the perfect Final Fantasy storyline…one day.

Judging at the 2006 US Imagine Cup

I have so much blogging to get caught up on, but such is the life of the release PM, as I claim to have been for the past month.  I hope the releases on CodePlex make up for the lack of entries =)

Several weeks ago, I got an awesome opportunity to be a judge for the 2006 US Imagine Cup.  I just love opportunities where I get to interact with students.  It all goes back to my days as Miss State ACM chair, where I got to organize company meet-and-greets, ways to spend our bank account, CS 101 study sessions, etc.  Anyways, it was interesting to see students use the technology I’ve been working on since I graduated.  One of the great things about blogging is that it allows me to better understand my customers, but this was the first time I got to see from a student’s perspective.  Yeah, I’ve wanted to schedule a trip back to Miss State and do some presentations there for the longest time to share what I’ve learned about Software Development, Accessibility, Software Testing, and now Shared Source / Collaborative Development.  I promise Dr. Reese I’ll get back to Starkville one of these days – i really miss the Sweet Tea (and the cups) and Chicken Salad Sandwich from Bulldog Deli.
Unfortunately, I was really, really tired after judging the entire morning (and trying to get our projects ready to go on CodePlex), so I didn’t get to spend as much time with students afterwards as I had wanted.  So, if you were there, feel free to drop me a line to chat.

Power Toys as Shared Source, Collaborative Development Software – Where we’re at and where we want to be

Those who have been following my blog since my days on the VSCore team probably have noticed that I haven’t blogged much about my new job here on the Developer Solutions / Power Toys team.  The golden rule of blogging has always been to blog smart, which implies blogging about the stuff that you know about (or get the expert of those areas to double-check your understanding).  I guess I could have blogged about how little I know about how and why people contribute to Open Source Software, but it wouldn’t have made for an interesting read – trust me.

So, after countless meetings with the Shared Source Initiative team, Bill Hilf’s team, my fearless mentor on OSS down the hall, WiX’s Rob (including staying late one Tuesday night to watch the team code – it’s crazy what I’ll do to succeed), and the CodePlex team, I have an idea how to kick start the collaborative-development for our power toys.

Josh wrote a post asking what does it take to be successful with collaborative development, and then posted some feedback

Let’s see how we’re doing with our power toys:

  • Well-formed code / code comments – since day one, we’ve made sure we wrote all documents and source code with releasing it to the community as a top priority
  • Unit tests – we’ve provided unit tests that for all our projects, along with test scripts that kick off running the unit tests.  This way project contributors can rest assured that their changes didn’t break mainline functionality. Also, we chose to go with tools like FXCop and NUnit to ensure that anyone who wanted to participate was able to.
  • Scenario tests - we’ve also provided scenario tests to verify additional coverage than just at the unit level.  We really want to make sure check-ins are of high quality
  • Design documents – we’ve provided documents written by the project developer to give a high-level overview of the project
  • Test Plans – One of the things I’ve learned from my software testing category is that a lot of people out there would love to know more about how to do software testing.  And we’re providing another example of how to do it.  Also, our test plans allow contributors to think about the impact a check-in may have to other functionality. 
  • Documentation – We’ve gone with calling our docs Readme’s, although I’ve always felt that a readme is more about “how to install, uninstall, and any gotchas you need to know about; whereas documentation is more about how to actually use the application once it is installed.  You’ll see us use the term interchangeably, but just note that both sets of information are included in one doc.  
  • Vision document – We haven’t gotten to this quite yet, but what I would like each of the tools to have is a doc that describes the scope of the project, what works well, what doesn’t work so well, what features could be added (that are in-scope).  Also this doc would mention things that are not in-scope.  For example, MSBee should only contain tasks related to building against .NET 1.1, and not become a repository of .NET 2.0 tasks. 
  • A good project leader – Currently, we have several people as leaders on our projects, including the PM for the tool, the developer who wrote the tool, and me (whatever it is that I do besides getting licenses approved for use).
    Experts -  We’re looking for a few good experts (or those who want to become experts) to join our projects.
  • Popularity – So far, we’re doing pretty well here, especially with “power toys” in your project’s title.
  • Completeness – I’m very curious to compare how the different tools we’ve provided meet users’ needs.  This will give us a better sense of where to invest our time with future tools.

My Power Toys WishList

Since I started back in January, I’ve been doing what I’ll describe as JIT (just in time) spec’ing.  I’ve tried to do some further out thinking by spec’ing consistency guidelines and such, but there’s a lot to do when you’re an early adopter for a new v1.0 site.  So, here’s a stab at some of the ideas I’ve had floating around in my head, where I would like to see the power toys get to.

  • All documentation provided in a Wiki that everyone has access to modify.  Of course, the project coordinator should always retain the right to lock or moderate certain pages.
  • A reputation system to honor top contributors, including Power Toy ship-it awards.  If you have any ideas, please let me know.  I’ve been thinking about this since I joined the team, but haven’t come up with anything I’m proud to share… yet.
  • Screencasts for using each of the power toys.  I’d like to also do a screencast of how to use CodePlex to get your environment setup for building and to walk through the steps of checking in code, using both VSTS and Express Skus.  As I said earlier, we really want everyone to be able to contribute, and the more instructions I can provide (wikis, screencasts), the more successful we’ll both be.
  • A really cool power toys logo that people can display on the blogs, indicating they are members of our power toys.
  • A Power Toys for Visual Studio Collection getting started guide that describes how both for internals and customers can add their tools as Power Toys

Just like Accessibility, I never thought I would get an opportunity to do something this cool at Microsoft.  So please, send me your feedback, thoughts, etc.  Let me know what your experiences are, for good and for bad, so I can make them ever better.

How to change the generated method stub code for C#

Before you apply this tip…

  • I strongly recommend that you backup any snippets installed by VS that you may want to modify.  Take it from a former code Snippet QA that you will want to do this.
  • This tip requires having access to your Program Files directory, so use appropriate caution
  • Do not change the title for any of the VS installed snippets

Create a function that hasn’t been defined yet and use the smart tag to generate a method stub.

Function not defined yet

You’ll get a method stub defined for bar() that throws a new Exception class.

Default Generated Method Stub

But let’s say instead of throwing an Exception class, you wanted it to throw NotImplementedException.

Open up
\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Refactoring\MethodStub.snippet

And change
<Function>SimpleTypeName(global::System.Exception)</Function>
to
<Function>SimpleTypeName(global::System.NotImplementedException)</Function>

You could use this approach to define your custom method stubs as you see fit.

Tags: VSTips
Suggest a Tip!

Hurricane Katrina’s Inundation of New Orleans Interactive Guide

Awesome guide to understanding what happened to New Orleans’s levee system Aug 29 – Sept 1.

http://www.nola.com/katrina/graphics/flashflood.swf

Just note that if you click on the Credits section (after you walk through the guide) on the Lagniappe section, there’s a bright flash (trying to mimic thunder and lightning) which is not exactly pleasent

Introducing the v1.0 Power Toys for Visual Studio – Shared Source Releases

Today we released our first three power toys as Shared Source, collaborative-development projects.  You can find them at their new home at http://www.codeplex.com.  For more info about CodePlex, I’ll refer to Jim’s blog,

Over 13 months ago (April 4, 2005 in fact) I posted something on my blog that I was leaving the patterns & practices team. Since that time we assembled a team of people and in turn built a community site for developers to innovate and participate in collaborative development projects. The web-site launched last Thursday, May 11, 2006 and is currently in beta. I encourage you to check out the site at http://codeplex.com .

Each project has the following documentation included in the source code Doc folder.

  • Readme – the basic documentation of the tool.  Included in the release download.
  • Design Doc – the developer’s design doc for the tool.  
  • Test Plan – the test plan that goes over how what scenarios to test and how to run the build and test scripts. 

Each project also has the following build and tests scripts found in the source code Verification Scripts folder

  • Build.cmd – verifies your modifications to the source code still builds successfully
  • RunTests.cmd – runs the associated unit and scenario tests

And now, here are our new members of the Power Toys for Visual Studio Collection.

MSBee

MSBee is an addition to MSBuild that allows developers to build managed applications in Visual Studio 2005 that target .NET 1.1.

Team Foundation Server Administration Tool

TFS Admin Tool allows a Team Foundation Server administrator to quickly add and modify user permissions to all three platforms utilized by TFS

Managed Stack Explorer

MSE is a lightweight tool that provides a quick and easy way to monitor .NET 2.0 managed processes and their stacks.

There are several ways for you to participate in the community.  You can do so by

  1. Blogging what you think about the tools
  2. Submitting bug reports and feature suggestions for any of the tools
  3. Asking and answering questions on our power toys forums
  4. Checking in bug fixes and new features

I’ll have more info on how to check in a bug fix or a new feature in a couple of days.  If you can’t wait until then to get started, email me and I’ll be very happy to set you up in the meantime =)

Oh, and we’re still hiring, so if you like what you see, ping Josh.

Aerial shot of Bay Bridge (taken on 28 April 2006)

My best friend from elementary school Ellen Felder took this photo a couple of weeks ago of the Bay Bridge that connects Bay St. Louis to Pass Christian.  You’re looking at the Bay St. Louis side.

http://www.flickr.com/photos/34052677@N00/144793732/

If I recall the stories correctly (and as the joys of blogs and radio talk shows go, someone will correct me if I’m wrong), after Camille hit, you could still drive across the bridge, but it was broken into three sections, forcing you to make a 90 degree turn several times.  Here you can see just how worse Katrina was.