BT

Facilitating the spread of knowledge and innovation in professional software development

Contribute

Topics

Choose your language

InfoQ Homepage News Sharing Code Snippets

Sharing Code Snippets

Bookmarks

When possible, commonly used code should be wrapped up in frameworks and libraries where you don't have to look at it. But when that's just not possible, we often have to turn to lengthy blocks of boilerplate code. This is especially true of patterns like IDisposable, where there is standard but it just can't be implemented at the library level.

One way to reduce the pain of building boilerplate code is Visual Studio's code snippets feature. Out of the box it has quite a few items for VB and a handful for C#. And while editing them has become relatively easy, sharing them with your teammates is another story.

One tool that could make this easier is Marckus's SnipPit. This open source project uses a SQL Server database to act as a repository for your code snippets. Unfortunately it doesn't integrate with VS's built-in snippet support, but one could see it being combined with Bill McCarthy's Snippet Editor.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article

Adoption
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.

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

Community comments

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

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

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.