Most IDEs have the ability manage and insert little code snippets to speed up development. When using Visual Studio, I leverage CodeRush as well as the native snippet facility. It’s great to manage your own snippets. But what if you want to share them with your team? You have a couple choices:
- Package your snippets, have your teammates copy the snippets on their local dev workstation.
Managing local snippets although straightforward makes it difficult to provide updates as the team size increases.
- Upload your snippet to a hosted snippet library (see below)
You can find hosted libraries such as:
- Snippets.DZone (listen to the interesting podcast interview with Peter Cooper, its creator, for insights on what makes DZone work great).
- CodeKeep – has a great plug-in for Visual Studio
Using a hosted snippet library is nice and convenient, but what about proprietary code? Also these libraries can be large and finding snippets is challenging depending on the tagging system used.
- Setup your own facility within your enterprise.
You can either try to find dedicated software (there are a few open-source options), build your own (more work than you think), or adapt other software. Googling around, I found that some people use blogging software (e.g. WordPress) with a special tagging plug-in (e.g. Ultimate Tag Warrior).
That last option is quite intriguing! It basically relies on your blogging platform to allow you to post code snippets instead of articles. You can then tag your snippet to fit the categorization / organization you desire. To put this in practice, I created a new subdomain: snippets, and setup a separate instance of WordPress with the tagging plug-in. Check it out!