BT

Sharing Code Snippets

| by Jonathan Allen Follow 576 Followers on Jul 23, 2008. Estimated reading time: less than one minute |

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.

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
Community comments

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

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