BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Snippet Editor for Visual Studio 2005/2008

| by Jonathan Allen on Nov 13, 2007. Estimated reading time: 1 minute |

Snippets are code templates that can be quickly accessed from the keyboard. They are not code generators per se, but rather just short cuts for common coding patterns. They support linked fields, so altering a variable name in one place will cause it to be altered throughout the snippet. The snippet will also automatically add any project references or import statements needed.

In addition to being a productivity aid, snippets serve as a training tool in Visual Basic. Snippets include instructions for tasks ranging from creating a property or new exception type through esoteric tasks like dialing a phone number using a modem connected to a serial port. To see a complete list of code snippets in VB, type ? then press tab. (It should be noted that C# also supports code snippets, but the built-in catalog is very limited.)

With the Snippet Editor, new code snippets can be created and existing ones edited to match the tasks and coding styles of each team. The snippets can then be sent as single files or packaged in a VSI. Currently there is no support for creating a shared repository for teams, but the possibility is there.

The snippet editor was originally released on GotDotNet. For reasons that are still not understood, Microsoft effectively deleted all of the content that was on the GotDotNet site when it was decommissioned. While some code was moved to CodePlex, the source for the Snippet Editor was not.

Bill McCarthy has recently brought back the snippet editor, source code and all, and added support for Visual Studio 2008. Express editions are also included for both versions.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Snipp Dogg by Jon Rogers

I found a better editor for snippets on CodePlex at www.codeplex.com/SnippDogg. Works great and is very easy to use. Hope this helps.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT