Channels ▼

Nick Plante

Dr. Dobb's Bloggers

The Pastebin, Evolved

July 27, 2008

Pastebins are a simple tool for sharing code snippets for public viewing. They've existed seemingly forever and are incredibly popular in IRC (you do still use IRC, right?) where they're used to paste larger amounts of code for discussion, analysis, and debugging. In return for your text, you're given a nicely formatted syntax highlighted page whose URL you can paste into the channel. Typical examples include,, and

Last week, Git repository hosting service GitHub demonstrated a new twist on the boring but useful pastebin concept with their latest offering, Gist. The novell thing about Gist is that any code that is pasted by a user into the service ends up becoming its own Git repository...

 This means that it can be cloned, forked (and corrected or improved upon by other users), modified, and pushed back to like any other  version controlled piece of code. For instance, a user seeking help in IRC can paste a code snippet, then update it as they receive feedback from the channel -- either from the web form directly or by cloning, editing, and pushing a copy from their local development environment. Another user may choose to fork that repository and create their own version, which they could later push back to the original (given the original author's permission).

This is all good stuff, and also bodes well for Gist eventually being usable as a larger code snippets library (once proper search is implemented). However, perhaps what's most important is that the pastebin interface remains the same; users can still enter text through a simple form and are given back a URL they can paste into an IRC channel or share via email. This means that you don't have to be at all familiar with Git in order to take advantage of it for simple version control of code snippets. It also means that you can revise documents direclty through a browser, creating new commits and generating document history without understanding any Git-specific instructions.

This transparent application of version control to shared code snippets is what makes Gist a true joy to use; it has successfully lowered the barrier to entry for contributing to open source and maintaining versioned code snippet libraries. Does this mean that an in-browser ability to fork and directly edit open source projects hosted at GitHub is next? This could certainly be useful for contributing small changes, such as documentation patches.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.

Dr. Dobb's TV