Skip to main content
5 Choices for Storing Code Snippets

Most programmers have a large collection of code snippets that they have developed over their years of authoring web sites, web applications, mobile applications, and so on. A good example of an excellent code snippet library is Chris Coyier’s online collection on css-tricks.com Chris gives us a full gallery of code snippets from CSS to Wordpress, this is a great place to gather some food for thought on your next project.

Rather then recreating small functions over and over again, programmers take these stored bits of code away to be reused when needed. Code snippets speed up performance by making functions readily accessible to save time typing, remembering, or looking up the correct syntax to say Hello to the world. There are so many choices out there for storing your code snippets, but what is going to allow you to be the most productive?

Choice 1: Local

There are many integrated development environments (IDE) for programmers to use, and a lot of these IDEs do have a way to store your code snippets. I myself use Coda, I find it to be the best IDE out there for me. Coda has a tool called Clips.
Clips. A friendly floating window allows you to insert your frequently used text snippets just by clicking, dragging, or tab-triggering. Nice!
-http://www.panic.com/coda/
I have many snippets in Clips. I am a crazy organizer so this tool is a dream for me. My favorite part about Clips is the tab-triggering. I have my most used snippets accessible with short keyboard commands, this saves me a lot of time typing and subtracts years off my eventual Carpal Tunnel Syndrome.

Coda’s Clips is a great solution for storing and using your code snippets, BUT.... I want more!
I want to not only store my code snippets, I want to share them on more then one device.

Choice 2: The Clouds

I want to have all my code snippets sync between my machine at work, home, and maybe even my iPhone. I want to be able to access my full arsenal of weapons whenever and wherever I need them.

A great little app for Mac users is Snippet. This app will sync via Apple’s Mobile Me for only $12.95. I like this app because it is dead simple, no bells and whistles that I don’t need. Snippet is a good solution but I don’t want to connect my Mobile Me account to my work computer, so Snippet is not the right fit for me.

Choice 3: Social Coding

My other choice is to find a web site to store my code, and maybe sync from that web site to a desktop application. There are web sites out there like http://snipplr.com that allow you to upload your code and share it with their community online. Snipplr is a great resource for all kinds of code languages, and their library is large and well-organized. I started an account with Snipplr, and then downloaded one of their recommended tools... Snippets.

Snippets($39.95) is a desktop application just for managing code snippets. Snippets is able to share all your code with Snipplr and a few other web sites very easily just by providing an API key and hitting share. I like the social aspect of sharing code via the Snipplr community. Snippets menu item “Edit in” button makes it really easy to access your code with all your favorite IEDs, you can click “Edit in Coda” and my snippet opens right in Coda.

Choice 4: Sync It

Exporting and importing my code onto another device is great, but I can also sync my code with a Snipplr Snippets datastore file via FTP or Dropbox. Now I have my home computer and my work computer syncing to the same Snipplr Snippets datastore file from my Dropbox account, so now I have access to my full code library whenever and wherever I need it.

Choice 5: Wishing

None of the listed choices really do it all. I wish Coda could give me a data file solution like Snipplr that I could sync too. I use Coda’s tab-triggering all the time, so I can just keep my most used Snippets in Coda’s clips and still sync all of my clips with Snipplr.

What about you?

What IED do you use?
Where do you store your code?
Drop me a comment :)