When programmers need to exchange or show some code to others, they don’t do it by email — please, don’t tell me you do. They use pastebin sites to share code snippets. Easy to use, these tools have almost become irreplaceable. Did you know that we’ve built our own? Before introducing it you, let’s do a quick tour of the most popular available tools out there.
Non-Runnable Code Snippets Sites
No need to present this classic anymore; Pastebin.com allows you to store any kind of text for easy sharing. However, it’s mainly used by programmers. You can store up to 10 pastes per day as a guest, probably more than enough for a vast majority of users. The site offers syntax highlighting for more than 100 languages. If you don’t find yours in there, you must be coding in a very weird language.
If you’re a Github aficionado, you’re probably already using Gists. Every Gist is a fully forkable Git repository. Surely you don’t need that for any code snippet, but it certainly opens up a lot of possibilities.
Runnable Code Snippets Sites
Being able to run a code snippet makes it much more powerful. You don’t have to just hope that your code will work. You can test it directly.
JSFiddle is probably the default site you’ll be heading for if you want to share a working frontend example. You usually find JSFiddle completing a StackOverflow answer, even if SO created their own homemade solution a few years ago. JSFiddle might not be the sexiest snippet site now, but try to remember what you thought of it 6 years ago. It was cool!
The amount of languages repl.it supports is impressive. It also has a bunch of interesting options as part of its environment, such as adding new files and the ability to use stdin.
The main drawback I see is that you can’t modify the code in an embedded snippet. However, they seem to focus on their classroom tool for now.
Runkit.com is worth mentioning for node. You can see it running live in the getting started section for Express. The amount of options it provides is pretty impressive. Also, for some React, Vue and Preact, you should definitely check Codesandbox.io.
We showed you our first version of runnable widget a few weeks ago. It was useful, but you had to create a complete playground just to share a code snippet. We changed that, and we are now super happy to present you with the runnable snippets by Tech.io.
We focused on providing an effortless experience to create, share and embed runnable code snippets in a wide variety of languages.
Not only are the snippets runnable, but you can interact with their embedded version. When reading an article, there’s nothing more satisfying than tweaking a code example and experiencing for yourself how the code works.
We use the official docker images for the snippets’ runtime for most of the languages (specific version detailed in our doc). That means we can easily add any new language. Also, we’re thinking about the possibility of being able to specify a docker image to use for a custom snippet.
What snippet sites do you use?
Perhaps some I did not mention; there is a huge –old– list on Wikipedia.
What do you think about our snippets tool? What features would you like us to add around it? As usual, any comment is welcome; don’t hesitate!