I recently bumped into a clever tool for soliciting debugging help. Pastebin is a web-app where you upload a snippet of code for others to review. Viewers can makes changes and suggestions to the code in a separate window. There are some handy features including syntax highlighting and the option to callout specific lines of code.
Here’s how it works. First, you paste a block of code into a textbox, and choose the language for syntax highlighting. Enter a name and click Send.
Here is what the code looks like once uploaded to Pastebin.
Pastebin generates a URL that you can use to point others at your code block. People can make suggestions on your code, including calling out a specific line using @@. See the example below where I entered a comment and made a minor code change.
Once the change is saved, Pastebin updates the code block to look as follows:
One additional trick you can do with Pastebin is create a sub-domain for your own specific debugging needs. For example, if I type in http://macdevtips.pastebin.com, I get a private area for working with code snippets. This area is still viewable by anyone (who knows or guesses the sub-domain), however, posts are not shown in the “Recent Posts” section at the homepage of Pastebin (it’s easiest to understand by simply giving it a try).
Pastebin is a nice tool when you need another set of eyes to look at your code.