August 16th, 2009
Recently I have seen a lot of links, especially on twitter, to some pieces of code hosted on some online code sites. I really liked the idea and started to use those site. Later on I discovered that they are called pastebins and have been existing for a long time, mainly among the IRC community.
Because each time I wanted to use this service, I wondered which one to use, I decided to do some comparison and outline the differences. Thus picked the ones I have most seen or used and compared them with each other. My chosen pastebins are:
Paste-it.net supports a very large number of languages. Almost all popular languages can be chosen from the list. Just as an example : C#, VB.NET Ruby, Java, Django, xml, etc. There are even some languages I have ever heard of. I Didn’t know for example that vim is a language.
Beside the big number of supported languages I like ability to set an expiration date at most. If you need to send some co-workers a small piece of code of some internal project and don’t want it to be persisted this option helps you minimizing this risk. Paste some code and make it disappear after one day.
The other interesting option is the hidden check box, with which you could hide your paste. I am not really sure how this works. You still can access this post without a password. I guess, it just will prevent you past from being listed.
When viewing a piece of code on paste-it.net you can change the language any time you wish. Beside this ability, you can’t change the theme. You have always the basic theme with a light background. For my this is almost always just fine. You could also view the raw code, download it as a text file of tweet it.
Right to the code you get a whole bunch of Google ads. All ads are in text format with no blinking or moving party, yet a really whole bunch of them.
Pastie.org is another simple and easy to use pastebin. The first thing took my attention was the absent of C# support (and actually all other .NET languages too) . I don’t thing adding support for C# will cause the developers any more effort. They could just the use theme of java for now. On the other hand, you can choose Pascal if you wish. Ruby, RoR, C++, etc. are some of the supported languages.
Pastie allows you as well to hide you pastes. On the other hand, it not possible to make the pastes expire after some period of time. When making a paste private, it gets a very harder name to guess instead of the usual serial number.
Another nice feature is the ability to change the theme on the fly. Not very crucial for me, but it still yet nice feature to have.
For making a bundle of code you Pastie provides you with the ability to define different sections inside your paste and giving each section a title. One limitation of this feature is that you cannot chose different language for each section. That means you cannot paste the controller code and the mark up of some mvc page.
One graphical ad is shown decently on the right bar. Nothing else.
Because of it lack of hiding and expiration settings it is really easy to go. Just paste a snippet, give it a title, choose the language and push the button. Some other optional information like author name and tags can be provided. After posting the code I couldn’t see anyway to edit the paste. Anyway you can register and log in to manage your pastes.
Beside “recent posts” codepaste.net provides also feed to pastes. I have no idea why anyone would like to subscribe to some bunch of non-related code snippets.
A very interesting feature is its API. It provides access to looking up, searching and posting. This may be very useful for integrating in other application like twitter clients. just like the URLs shorteners.
Unfortunately codepaste.net doesn’t provide a link to the raw source code, what makes copying some piece of the code a bit harder.
gist.github.com is a service from Github, the popular project hosting service. When using gist you get all benefits of Github. Each snippet you post to gist become a Git repository with all the known capabilities like cloning, editing and pushing. Taking the embedding facility into consideration, gist.github.com is a very powerful way to post code into some html page and keeping it up to date.
Wikipedia has also an article comparing some other pastebins.