How to start a Programming Blog

I started my blog a little over 2 years ago. I based most of my decisions in terms of blogging platform, hosting and domain names on 2 articles – Be Your Start-up by Jay Fields and Starting a Programming Blog by William Shields. (If you are intending to start a programming blog those are still excellent reads)

Now that I have a fair amount of experience with blogging – and having recently made some major changes to my blog – I thought I would add my 2 cents to the mix.

Choose your platform

This is your starting point. There are numerous options available – Blogger, WordPress, Tumblr, Movable Type, TypePad, etc. (The big players seem to be Blogger, WordPress and Tumblr) When I started out I chose Blogger – Jay Fields used and endorsed it and it’s owned by Google – obviously it has to be good. To be honest I have come to regret this decision.

So here’s a brief rundown of how a blog works – you write something in an editor of choice (more on that later) and upload it to your blogging platform. Your blogging platform will then use some kind of template to display what your wrote – basically your words go in and a whole heap of HTML comes out. Configuring your template is the tricky part – and the template language is different for every blogging platform.

Most of the free blogging platforms allow you to use only one template – this means that one piece of template code will be applied to every page served by your blog – blog posts, the main page, the archive page, tag page, about page, etc. They usually also don’t allow you to host any CSS or JavaScript files.

Two years ago Blogger might have been an ok choice, but nowadays it seems to be sub-par. The default themes haven’t been upgraded, the documentation is atrocious and the support is pretty much nonexistent. I tried to write a Blogger template from scratch and the only support documents I could find all pointed to a link which no longer exists. If you wanted to know what tags you can use in your template you’re pretty much on your own.

I recommend WordPress – if I could go back in time 2 years and give myself some advice, that is the only advice I would give. WordPress allows you to completely customize your template (even from scratch – very appealing if you’re a web developer) and you can create a different template page for every page on your site. For example, I use a slightly different template for my homepage, search page, archive page, tags page, etc. Complete control.

There are 2 negatives from my point of view. Firstly, you need to get a hosted solution. I use Bluehost – they seem to be the most popular choice for hosting WordPress sites – and I pay $5.95 per month. I don’t have any complaints about them – installing WordPress literally took 1 minute and their support has been excellent. The second negative is that the WordPress templates are written in PHP. This wasn’t really a problem – the documentation (on the WordPress site) is excellent and figuring out enough PHP to be able to write my templates was trivial. (In any case, Blogger templates are defined in a really ugly and bloated XML structure – which is definitely worse)

Choose your domain name

Jay Fields covers this quite well in the article I mentioned, so I will simply say: buy your own domain name (yourname.com). I bought mine through Google Apps, but the actual registration is on GoDaddy. Again, this will cost you – $10 per year. I would recommend that you choose automatic renewal – Google will warn you twice before they do the renewal (with the option to opt-out).

Design the look of your blog

This is a tricky part. As with designing any website having some experience really goes a long way. If you have absolutely no experience with web design you can either choose one of the default themes, buy a theme or get a professional designer to create one for you. If you are a web developer or you have at least some web experience I would recommend that you look at as many blogs as possible to give you some ideas for your own design.

If you’re creating your own theme I would recommend that you create a complete HTML mockup and then integrate it into a theme. WordPress has excellent documentation on this and there are also quite a few useful websites to guide you.

Use a Syntax Highlighter for Code Snippets

If you are starting a programming blog you’ll probably want to post some code snippets at some point. Some developers choose to post pictures for code snippets which means anyone who wants to use your snippets would need to recreate them – not ideal.

The best solution in my opinion is to use SyntaxHighlighter by Alex Gorbatchev. You simply wrap your code snippets in a pre element with an attribute to specify the language. You then need to include several JavaScript files which will then do the proper highlighting and markup for you. You can either host these files yourself (which I would suggest) or you can use a free hosted solution.

Your code snippets will still work correctly in your RSS feed (more on that later), but the highlighting will not be there.

Choose a tool to write your Blogs

So now you have a blog and you want to write some posts. What do you use? Most of the platforms have some kind of online web-based tool which you can use, but it’s generally not the best way of writing new posts.

If you’re on Windows it’s an easy choice (in my opinion) – use Windows Live Writer. It’s free and it’s fantastic. It integrates with pretty much every blogging platform, it does offline previews using the theme on your blog, it integrates with Picasa for hosting images and you can even get a plugin that integrates with the SyntaxHighlighter stuff I mentioned above.

If you’re on OSX the choice doesn’t seem to be so easy – everyone seems to use a different tool. I’ve settled on Mou – it’s a very lightweight Markdown editor. I write my posts using Mou and then copy the generated HTML into the WordPress editor. The only part I find slightly tedious is that I need to manually upload and link my images on Picasa.

Use FeedBurner

If readers enjoy your posts they might choose to subscribe to your feed. Again, most platforms expose a feed by default, but you might choose to publish your feed through FeedBurner. It wraps a neat interface around your feed and allows you to switch to another domain without losing all your subscribers. I would highly recommend that you sign up for an account and expose only the FeedBurner feed via a link on your blog.

FeedBurner has the added benefit of giving you statistics on your subscribers.

Use Google Analytics

This is a no-brainer. You simply sign-up for an account and include a small snippet of JavaScript code on your blog. You then get access to very detailed and useful reporting on everyone who visits your blog. You would be mad not to use it.

The rest is up to you

I’ve left out the most important part here – the content! The two articles I mentioned cover that in more detail – I was mostly trying to cover some of the logistics around creating and maintaining a blog.

If you have some suggestions to add or you have any questions about my experience on blogging, leave a comment below. Happy coding.