Grambo's Blog

Discovering Cucumber

A few months ago I was having a browse of some of the jobs on stackoverflow careers and I came across a job posting for Amazon. I wasn’t intending on applying for the job, but I decided to have a look and see what sort of skills they were looking for. I was a little surprised to find that there were some terms in there that I couldn’t even begin to guess what they meant. BDD? Cucumber? What are these things?

The Importance of Consistency

Sometime in the past couple of weeks I posted a quick tweet complaining about inconsistencies in other people’s code. I had a hard time condensing everything I wanted to say into one (or even a few) 160 character block(s), so eventually just gave up and posted a quick moan. However I felt compelled to elaborate on my thoughts a little bit, so here I go.

Consistency. It’s one of the most important, perhaps the most important aspect of modern software development. Consistency in code helps other programmers (or your future self) better understand unfamiliar areas of a system. Similar benefits can be obtained from consistent system design; Someone unfamiliar with a particular part of a system may be able to make some assumptions about how it works based on their previous experiences. Even a user interface benefits hugely from a consistent look, feel & behaviour.

In this post, I primarily want to talk about coding consistency, though I’ll maybe touch on a few other bits and pieces.

What C++11 Features Does My Compiler Support?

I’ve recently become obsessed with C++11, the new standard for the C++ language, that massively improves certain areas of the language, and brings all kinds of modern features that other languages have enjoyed for ages. At present C++11 support is a bit patchy - no one compiler supports all of the standard, and most of them have chosen to implement different bits first.

When working in C++, I make use of about 3 compilers - the visual c++ 2010 compiler, and 3 different versions of GCC. Which of course means that I’ve got 4 different C++11 feature sets to bear in mind. This isn’t an easy task so I regularly have to loop up the supported feature tables before I actually use a feature. I’m also thinking about switching some of my projects over to use clang (at least on linux), which should complicate things further.

Adding Facebook Comments to Octopress

Today I decided to have a go at adding comments to my blog. Octopress comes with built in support for comments using disqus, but I wanted to try and do something a little different. Facebook comments seemed like a reasonable alternative - there’s no additional login required, all posts have to be backed by a facebook profile and it’s fairly easy to setup. I also like the option to reduce visibility of comments - in this mode, comments will only be viewable by the poster, an their friends. Sounds like a fairly good way to cut down on crap.

In an attempt to save myself a little learning time I had a look on google for a guide to setting up facebook comments on Octopress, but had no luck finding anything. So, I’m going to walkthrough the (fairly straightforward) process here, in case anyone else wants to try it out.

On Octopress

So, this is a blog. Clearly. Currently not the most exciting of blogs, but hey - got to start somewhere. I’ve chosen to host my blog using Octopress, and thought I’d write a bit about my experiences with setting it up, and some of the tools I’ve decided to use with it.

Octopress is billed as “A blogging framework for hackers”, so as you might imagine is not really an ideal choice if you’re looking for point and click simplicity. Configuration and posting is entirely done through editing and creating text files, which octopress processes to generate static HTML for publishing. Not great for anyone looking for a nice GUI to manage their blog, but also nothing overly complicated.

The text based nature of octopress also brings a number of benefits:

  • Easy backup and version control using git
  • Very easy deployment via git or rsync
  • Next to no server load
  • No need to setup MySQL, PHP etc. on server

The environment setup for octopress is brief, which is exactly what you want - a few commands and you’re up and running. Unfortunately one of those commands involves compiling ruby. This doesn’t add difficulty, as all the usual configure/make/make install is handled behind the scenes for you. However it does add a bit more time than I’d have liked. On the slow atom processor in my server, it probably took about 20 minutes to compile - hardly ideal for an impulsive test of some software.

After the initial environment setup it’s just a case of cloning the octopress git repository, and changing a few configuration and theming files to your liking.

By default octopress uses Markdown for formatting, so I’ve chosen to use MarkPad for editing my blog files. MarkPad is a nice simple open source WYSIWYG editor for markdown. It also seems to support jekyll format files, which are used behind the scenes by octopress. It’s not entirely suited to using with octopress - it doesn’t seem to generate the same file names as octopress expects, and the date format in the headers is different, however I’m planning on looking into ways to improve that.

All in all I’m quite happy with octopress for now, hopefully I actually find enough topics to write about that I’ll use it regularly.