After file and photo sharing, it’s time for “code sharing”

If we want to share a file or photos while chatting with our friends on internet using IM tools like GTalk, we use file sharing services available online. These services allow us to upload a file to their servers and give us a link which we can share with our friends. But what if you are a developer and want to share a small piece of code with your friend? You are left with following choices:

  • Paste it in your chat: I know most of us do this when we quickly want to share the code. However, its annoying as it becomes unreadable and makes your code look as if its obfuscated :)
  • Email: This approach is better compared to previous approach, however the recipient wil need to manually compile the code and run it if he wants to know the output.

I won’t say these approaches are useless. But I would like to have a place, where I can put my code fragment and then share it using a link. I can use this link in my gtalk status, chat or even in twitter posts.

Luckily, there is a site called “codepad” that allows us to do exactly the same thing. It allows us to share a piece of code using a small url.

You can try it now at “” or take a look at this example code posted by me at “

Finally, one thing I would like to see is support for C# code.


  1. Codepad is great for executing the shared code. But if you just want to share then there is also pastebin[dot]com and pastebin[dot]me

    One nice feature of pastebin[dot]com is the private(not password protected though) pastebins. Just type any sub-domain like rohits-secret-project[dot]pastebin[dot]com

  2. Thanks Rohit.

  3. i see a problem when dealing with dependencies. ;-0
    As far as my experience goes, you copy paste code snippets with the assumption that your team mates environment is identical to yours.
    i tried this:

    int main(int argc, char* argv)

    another very mischievous thought strikes my mind.
    how about the popular php code to send a mail? ;-B

  4. Is not the neater solution to build a code snippet aware IM / Email client? Or a plugin to one of the existing major IM/Email clients.

    Fits in with current user behavior.

    Smaller change in behavior == smaller barrier to adoption.

Speak Your Mind