The Top 5 Places to Share Code Quickly

Collaborative development or getting development help from your peers online dictates that you share code with people, but that’s not always possible. If you’re on IRC, pasting giant blocks of code into a public chat channel is annoying for everyone else, and sharing code via instant messenger or email is clumsy, slow, and hard to read (since those tools lack code formatting and line numbering).

That’s where pastebins come in. Pastebins allow developers to post code snippets at shareable, throwaway URLs in order to easily swap code back and forth unobtrusively with one another. There are a large number of pastebin sites, and the differences between them are generally minor. However, below is a list of our top five places to easily and quickly share code. Presented in no particular order.

Pastie

Pastie isn’t the most feature rich pastebin site out there, nor does it support the most languages, but it is one of the most elegant. What Pastie lacks in features, it makes up for in simplicity and beauty. The site offers private pasting and pastes don’t expire. For more feature rich code pasting, check out Paste2, Pastebin.com, Lodge It, Pastebin.ca, and GnoPaste.

Gist

Gist is one of the most robust paste tools on the Internet. What sets it apart from other pastebins? How about versioning, SSL security for private pastes, support for embedding pastes on other sites, and the ability to push and pull pastes using Git. Like parent site GitHub, public pastes on Gist (called, not surprisingly, “gists”) can be forked by other users with the click of a button.

GitHub’s active user community has also contributed to Gist by creating a growing ecosystem of extensions, such as auto-posting to Tumblr and Textmate support. You can even serve Greasemonkey scripts from Gist. Very cool.

TinyPaste

If you crave pasting that is more succinct and to the point, then perhaps TinyPaste is for you. TinyPaste is a barebones pastebin. Just enter your code and go. No futzing with names, descriptions, choosing a language, etc. Unfortunately that also means syntax highlighting is out the window. But if you just want to paste and go, then TinyPaste might be what you’re looking for. The site also has a Firefox plugin that allows you to paste text from any text source (within the browser) and get the paste URL without ever visiting the TinyPaste site, and it has an API.

Also see Snipt, which is billed as a pastebin for Twitter. Theoretically, that means it should function much the same way TwitPic does for images — unfortunately, right now it appears to just be a run of the mill paste site with short URLs for pastes. Hopefully they add things like auto-post to Twitter and the ability to target pastes at specific users via @ replies.

EtherPad

EtherPad is not actually a paste site, but if your reason for pasting is because you’re working through a coding problem with a collaborator, then it might be better than any other site on this list. EtherPad lets users collaborate in real time on text documents. Users each join a workspace and can watch each other make changes in real time — if user A types something new, user B sees it appear on his screen in real time.

Because EtherPad isn’t a real pastebin, it doesn’t support syntax highlighting for many languages, but adding that should be fairly trivial. It does have line numbering, though, so even lacking syntax highlighting, it should be suitable for collaboratively working through a coding issue in ways that a static pastebin couldn’t hope to match.

Snipplr

Like EtherPad, Snipplr also isn’t really a pastebin. Rather, Snipplr is a public code snippet library, and one of the best. If you want to share your code bits with more than just a few people, Snipplr is a great place. It is a very well designed snippet site with over 10,000 snippets. They have a Textmate bundle, a WordPress plugin, Firefox and Safari bookmarklets, and even a plugin for the somewhat more obscure Gnome text editor Gedit.

Also check out DZone Snippets, which is another large public snippet site.

If you know of any other good sites or methods to share your code, please share them in the comments below. And if you liked this post, be sure to check out 7 Places to Find the Code You Need.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Anonymous

    dpaste!

  • nicksergeant

    Also see http://snipt.net, not to be confused by the Twitter-focused snipt.org.

    Snipt.net is more geared towards the beautiful and elegant approach of pastie.org, with more functionality and organization.

  • dingus

    snipt.net!

  • nicksergeant

    Sorry for the lame dupe post – one was before I registered.

    Anyone wanna delete the first one?

  • stonethestone

    I think you should check http://www.codesaw.com too. Fairly good feature set.

  • http://altoonadesign.com halfasleeps

    I just checked out pastie, very nice I like it a lot. I really like that I don’t have to create an account before I can start using it. This seems very convenient and I plan to use it a lot. How long do the snippets stay on pastie before they expire?

  • http://www.2upmedia.com 2upmedia

    pastebin.me is one of my favorites since I work with xHTML, CSS, and jQuery. It allows you to not only share your code, but preview it live and it comes with a few basic templates that makes testing new code much faster.

  • http://www.mockriot.com/ Josh Catone

    @halfasleeps: AFAIK, they never expire — there are still pastes on the site from 2006. :)

  • kira8080

    The tabs characters seems to be lost in the process…

  • dan

    Snipt.org does allow you to tweet your snipts via the “twit this” link at the bottom of each “snipt”. You can also rate, email, bookmark, and embed snipts.

  • Rob

    I think you should check out http://www.sourcepod.com ;)

  • http://www.gammaworld.org/ mutant

    http://pastebay.org/ by the folks from pirate bay.

  • G-Coder

    I like http://codeupload.com/ has really nice features