views:

37

answers:

2

I am looking for a quick way to share code snippets between developers. Visual studio allows you to use a file share as a repository for snippets, but the VS Snippet manager seems more oriented towards "permanent" snippets you want to keep around. I'm just looking for a good way to send a block of code to another developer to look at, or copy into their code.

Instant messengers tend to have character limits and don't really retain formatting well. I could use something like pastebin, but I really don't want to expose this code to others potentially for non-disclosure reasons (regardless of how much those snippets may or may not be sensitive, still have to maintain NDA). I know, Pastebin has a private mode, but it would still be a grey area to my bosses. They would argue that you can forget to mark it private and then the code is out there public.

I could save the snippets to a file, and then send them via IM or file share, but that's just a lot of hassle.

Ideally, i'm looking for something free.. open source or not doesn't matter. And i'm looking for something that's very fast to use without a lot of hassle for each snippit transfer, and is privateish between the sharer and sharee.

I was thinking about writing such a plug-in for VS, but if there's already something out there, i'd rather use that. So if you have any suggestions, i'd love to hear them.

EDIT:

I'm having a hard time believing something like this doesn't exist. It seems all the snippit managers are designed for long term storage and retrieval. Ideally, I'd like something like OneNote's "Side Note" that pops up a quick window, i can past something in it, then send it to a co-worker, then have that pop up in their screen. No storage, no archival, no keystroke integration to paste it into your code..

A: 

If you are using GIT, you can easily email a patch or share to a common branch. One of the many benefits of using GIT :)

bwawok
I am using subversion. But in any event, we are talking about collaborative here.. we could send 100 snippets back and forth and we don't want to clog up email (or wait for delivery, which can sometimes be somewhat delayed)
Mystere Man
You can commit a revision into a temp git repository in a few seconds, faster than pasting in anything.
bwawok
+1  A: 

How about a shared Google Docs document?

Lachlan
That's a possibility, i was hoping for something a little more integrated into VS, but it's a good fallback idea if nothing else seems to fit.
Mystere Man
I've had a lot of trouble with Google Docs and pasting formatted code into it. It seems to double up lines and then get javascript errors. Not too useful.
Mystere Man