Tel: 01206 808090 Email: email@example.com
We make websites, and websites are written using code. When you’re running a business like ours – that’s rapidly expanding – taking on more employees and more work, it’s easy to forget about how we work with code and focus management time and efforts elsewhere. But code is at the core of what we do. More importantly, well written, well documented, clean and semantic code is at the core of what we do.
We now have four employees whose full time job is to write code; Sam, Tom, George and myself. We’re split evenly across back-end and front-end development, but there are big overlaps in the work that we produce. I’ll sometimes dabble into some PHP to get something working for the front-end that I’m building, or Sam might write some JQuery interactions to try out some back-end stuff that he is developing.
It is sound advice (almost gospel even) to ‘always code like you are in a team’. This means having clean, clear, well documented code that another developer can look at and quickly get an idea of what it is, what it does and how they can work with it.
As the development team has grown it has become more and more apparent that we needed a smarter and more central way of managing the code that we write. Recently, we addressed one small part of this problem.
When you work on a large number of projects, patterns in your code are bound to emerge from time to time: the same piece of functionality, similar layout or styling. What is the point in wasting time writing out the same piece of code time and time again when there are a million other things to get done on the project. Sometimes you just want a quick and simple way of inserting something that you, or another member of the team has already written.
Up until a little while ago I had a code library (of sorts) stored in a simple set of files on one of the resources drives in the office. It served a purpose, but it wasn’t very clever. It was only accessible from within the office, it was slow to find what you wanted and slow to get the relevant code into the document that you’re working on.
So, the solution. We needed a central, online storage facility, and a lightning fast way of interacting with it.
We found this provided by GitHub, or more specifically by GitHub Gists. Where GitHub is a repository for full projects, GitHub Gists allows you to store and manage a library of smaller snippets of code. Because Gists run on Git, they are also open to versioning, meaning that we can update our snippets over time, but roll back and access an older version at any point.
The latter is made possible by our new text editor of choice, Sublime Text 2. Words cannot describe how much of a difference this amazing little app has made to productivity. It is a world away from slow, hand holding editors like Dreamweaver. I don’t want my hand held, and definitely do not want slow! I want a fast text editor with a minimal interface and tonne of power under the hood that’s ready to hulk out when I need it. That is what ST2 is, and it integrates with GitHub and (more importantly for this issue) Gists.
The combination of these two tools allow us to quickly create, search for and insert a specific snippet of code at the drop of a hat. Everything is organised and aptly named, is accessible from anywhere, easily updatable and did I mention it’s quick?!
This is just one small step towards a bigger goal of working with code in the most accessible and efficient way, but it is already having a big impact on our work.