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.
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
, Lodge It
, and GnoPaste
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.
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.
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.
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
Frequently Asked Questions (FAQs) about Sharing Code Quickly
What are the benefits of using online platforms to share code quickly?
Online platforms for sharing code quickly offer numerous benefits. Firstly, they provide a convenient and efficient way to share code snippets with others, especially when collaborating on a project. This can significantly speed up the development process. Secondly, these platforms often come with syntax highlighting, making the code easier to read and understand. Lastly, they allow for easy version control, enabling developers to track changes and revert to previous versions if necessary.
How secure are these platforms for sharing code?
Can I use these platforms to share code privately?
Yes, most of these platforms offer options to share code privately. You can create private snippets or repositories that are only accessible to specific users or teams. This is particularly useful when working on proprietary or sensitive projects.
Can I use these platforms for long-term code storage?
While these platforms are primarily designed for quick code sharing, many of them also offer features for long-term code storage. You can create repositories or projects, organize your code into folders, and even track changes over time.
Can I collaborate with others on these platforms?
Absolutely. These platforms often come with collaboration features, allowing multiple users to view, edit, and comment on the same code snippet. This can greatly facilitate teamwork and improve the overall development process.
Do these platforms support all programming languages?
Most of these platforms support a wide range of programming languages. They often come with syntax highlighting for many different languages, making it easier to read and understand the code. However, it’s always a good idea to check the platform’s documentation or FAQ to see if your preferred language is supported.
Do I need to install any software to use these platforms?
No, most of these platforms are web-based, meaning you can access them directly from your browser without installing any software. However, some platforms may offer desktop or mobile apps for added convenience.
Can I use these platforms for free?
Many of these platforms offer free plans, which are often sufficient for casual use or small projects. However, for more advanced features or larger projects, you may need to upgrade to a paid plan.
How do I share my code on these platforms?
Sharing code on these platforms is typically straightforward. You simply paste your code into the editor, choose the appropriate language for syntax highlighting, and then generate a shareable link. You can then send this link to others, who can view or edit the code as needed.
Can I get feedback on my code from others on these platforms?
Yes, many of these platforms have a community of users who can provide feedback on your code. This can be a great way to learn and improve your coding skills.