InfoQ

News

Snippet Editor for Visual Studio 2005/2008

Posted by Jonathan Allen on Nov 13, 2007 06:09 AM

Community
.NET
Topics
Artifacts & Tools
Tags
Code Generation

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.

2 comments

Reply

Snipp Dogg by Jon Rogers Posted Apr 5, 2008 12:57 AM
qwqw by berkay NiQuiL Posted Jun 30, 2008 12:08 PM
  1. Back to top

    Snipp Dogg

    Apr 5, 2008 12:57 AM by Jon Rogers

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

  2. Back to top

    qwqw

    Jun 30, 2008 12:08 PM by berkay NiQuiL

Exclusive Content

Rationalizing the Presentation Tier

Thin client paradigm characterized by web applications is a kludge that needs to be repudiated. Old compromises are no longer needed and it's time to move the presentation tier to where it belongs.

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.