BT

Sharing Code Snippets

| by Jonathan Allen Follow 638 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
BT