Back to the Lion’s Den – open-mic #2

I’ve been away on holiday and wanted to get on stage as soon as possible, so I went back to the Lion’s Den Comedy Car Crash open-mic night on Tuesday evening and got there early to make sure I got a spot.

While I was waiting to get in I got talking to a guy called James SorryI’veForgottenYourSurname who I’d seen a couple of weeks earlier doing his first open spot on the same night I did mine, and once we got into the club we compared notes over a beer. It was good to get a perspective from somebody who’s in the same situation as me – up until that point the only other acts I’d really spoken to are the people who did the course with me.

As the bar filled up ahead of the show, a few more people from the previous show turned up, nods of recognition and chit-chat ensued, and I was happy that people remembered my act well enough to comment on some of the material I’d delivered a couple of weeks ago.

My plan for these early open-mic nights was to get more comfortable on stage and start to piece together a respectable five minutes of material that I can memorise completely, so that when I’m on stage I can focus on delivery rather than thinking about what I’m going to say next. But during the day I thought up some topical stuff that neatly tied together a couple of big news stories of the week, and I really wanted to use it while it was relevant. So I decided that tonight I’d start with the topical stuff, and then run through some of my existing bits if I had enough time.

I wanted this to be the first time I went up without any notes but, because I was doing some new material, I decided that I needed to scribble a set-list onto my hand. Lessons: write it on the back of your hand because if you write on your palm it’s going to get smudged by condensation on cold beer bottles; also,  biro doesn’t wash off easily so you may end up going to work in the morning with random shit written on your hands.

At the Lion’s Den, they draw the the next performer’s name out of a bag after each act, so you never know when you’re going up. Last time I went up very early and this time I went up close to the end, which was fine except for the fact that a lot of people had already left so the room was half empty. No problem, I’m sure there are going to be a lot of nights like this – I’d just plough on with my act, even if the room was silent for five minutes.

I forgot to record my set, so I don’t fully remember how it all went, but….

One of the other acts did some crowd work earlier and called me out for being a gym-rat (nice that people notice!) so I opened with an improvised call-back to that, which earned an OK laugh, before launching into my topical material.

This section went OK, considering that I hadn’t worked it all the way through, some bits didn’t have solid punchlines, and I didn’t deliver parts of it as well as I’d hoped – but it was pretty dark, which the audience liked. There were titters throughout and one or two bigger laughs. Again, the laughs didn’t always come where I expected, and some bits fell flat. When a punchline gets nothing I just push on, don’t acknowledge it, just go straight onto the next bit – I don’t know if this is the best way of handling it, but I’d rather just move on and try for the next laugh than waste time.

The segue into the existing material that I wanted to practice was clumsy, and I think that threw the audience a little. It went down reasonably well, considering the empty room, but I didn’t do the best job of delivering it and think it could really work better if I add a bit more flair to the performance. On the upside my timing was pretty much spot on, and by the time I got the light to let me know I had 30 seconds left, I was ready to deliver my closer.

Again, my link to this bit wasn’t smooth so it didn’t flow well and although it got a small laugh it wasn’t what I hoped for. I also didn’t really end the set gracefully, just put the mic back and wandered off stage while they were tittering – I should probably thank the audience or something instead of just fucking off awkwardly.

I felt a lot more relaxed on stage this time around I was able to think more about my delivery, even though I’ve still got a lot of work to do on that.

The act who went up after me seemed reasonably polished and had some good material, but he started his set by saying “I’m not sure I can follow that guy…” which gave my ego a boner. I promise not to milk every shred of positive feedback I get, but at this early stage I’m clinging to any encouragement that suggests I’m not just making a massive twat of myself and that I might eventually become a passable stand-up.

The final act to get drawn was James, the guy I spoke to at the start of the night. For his second time he did brilliantly – he’s got some great material, delivers it well and already looks relaxed on stage. Wouldn’t be surprised to see a lot more of him in future.

Final note – I’ve been given a spot at the Funny Feckers night in Camden at the end of September, so I’m aiming to get as polished as I can before that night. I know they film the acts and it would be great if I could get a video of a killer performance, so that means I need to get as much stage-time as possible before then and really focus on putting together a five minute set that I know is going to work well.

My first stand-up comedy open-mic night

The stand-up course is over and the excitement of showcase night has faded, but a handful of us are keen to make sure we don’t lose momentum so we’ve started investigating London’s open-mic nights. The week after showcase a few of us headed up to Funny Feckers at the Constitution in Camden just to scope it out and get a feel for how an open-mic night works.

In the bar ahead of the show we had a chat with the organiser, Wes Dalton, and learned that the open spots are usually booked a month or two in advance (turns out this is the case with a lot of nights). By coincidence it was Funny Fecker’s first birthday, so there was a really good atmosphere in the club and a decent sized audience.

The mix of experience amongst the 10 acts was varied, some first timers, some veterans, but the audience was friendly and treated all of them well. One act in particular stood out – I forget his name, but his routine was a bit like Data from Star Trek delivering different styles of stand-up in a way that deconstructed familiar comedy tropes. I loved it, but it got a mixed response from the crowd – I hope I bump into the guy again.

I left the night feeling pretty positive and confident that I wouldn’t embarrass myself too badly if I performed alongside a similar line-up.

The following week I went to the Lion’s Den open mic night at a club on Shaftsbury Avenue with a couple of comrades, and queued up early so that we could get spots. This was a different vibe entirely, but still good fun. There were about 20 acts in total, and the quality varied immensely – some were very funny, some showed promise, some were terrible, others seemed to have very real psychological problems.

One youngish guy, who’d done a handful of spots already, had invited a bunch of his mates to watch him perform, but he completely choked on stage and after a minute of fumbling walked off without delivering a single gag. His mates captured the whole thing on their phones for the ages.

The thing about Lion’s Den is that the MC picks the performers at random from a hat, so you never know when it’s your turn to go up, which is nerve wracking when it’s your first open mic. As it turned out I got called up third, completely mentally unprepared.

I had my original set-list from the showcase night and reasoned that if I trimmed the fat and just focused on the main parts of the set I should be able to keep it to five minutes. It went well, I got laughs from beginning to end, and improvised a tag-line for a bit based on something in the news that day which got a big laugh (it helped that the line was in disgustingly poor taste, which I am proud of).

I also got a decent laugh out of a bit that was originally just supposed to be a tag line from a stronger gag, but I’m starting to think it could work as a larger bit because the audience responded so well on both nights I delivered it.

The big fuckup on this night was that when they flashed the light to let me know I only had thirty seconds left I was only about a third of the way through my material, and I panicked because it caught me off guard. I’d just delivered a punchline and got a reasonable laugh, so I could have just smoothly ended it there, but instead I fumbled for a couple of moments trying to work out how I could close before abandoning the idea and then awkwardly thanking the crowd and leaving the stage. It wasn’t awful, but I could have handled it better.

Lessons; Time. My. Fucking. Set. Better. Also, memorise a solid closer that I can always go to if the light comes before I expect it.

A good night though, friendly crowd, supportive MC, my two buddies from the course both did well too. During the half-time break one of the older, more polished acts gave me a nod and thumbs up from across the room – a small gesture, but at this stage I’ll take whatever morsel of encouragement I can get.

If anything, this felt better than showcase night. This was a real open spot, the audience wasn’t friends and family, just other acts and their mates. This felt like a real first step in the direction I want to go.

Showcase night – my first stand-up comedy performance

After six weeks of playing around on the stand-up comedy course every Wednesday evening, suddenly it was time for the showcase night. This was the main reason for me doing the course – I could have just turned up at one of London’s many open mic nights, but I was struggling to take that first step and I felt like this would help me get moving.

The show was in a bona-fide comedy club, downstairs at the Comedy Pub on Oxenden Street (just a few doors down from the Comedy Store – one day, maybe…) and the audience was made up of about 70-80 people invited by everybody on the course. There were 11 of us performing, with the running order chosen by the course tutor, Kate Smurthwaite who also MC’d the evening, and I was chosen to go up second to last.

While everybody sat down to watch the acts, the performers hid at the back of the bar, whispering support to each other and waiting our turns to go up. Everybody went up, nobody choked – the quality was variable but everybody threw themselves into it and got some laughs from the crowd, and one or two people surprised me with how well they did.

I was feeling pretty comfortable about going up. I’d already resigned myself to using a set-list because even though I can remember each of my bits perfectly well, I couldn’t remember which bits I was going to do and in which order. I didn’t care about looking ultra-polished, I just wanted to deliver my material to a crowd and see how it landed.

The thing that threw me off when I got onto the stage was how hard it is to see the audience with stage-lights in your eyes. When I talk at conferences I’m used to being able to see the audience’s faces and gauge how they’re responding, but on stage the only feedback available was the sound of laughter, or silence.

I’d already written what I think is a pretty strong opener but, because I’m an idiot, I got cocky and spontaneously opened with a bit about accidental fisting that I’d only just thought of. I fell in love with the opening line of the bit, which certainly got a solid laugh, but I hadn’t had time to work it all through so it meandered on for too long before arriving at a fairly unsatisfying punchline. The punchline worked, but wasn’t strong enough to justify the rambling length of the bit.

I got back on track and delivered the material that I’d actually written – glancing down at my set list every now and then to remind myself of what bit was coming next. I didn’t record the set, so I don’t know exactly what worked and what didn’t, but it felt like I was getting a respectable number of laughs. Sometimes they laughed at the wrong places, and sometimes the punchlines fell flat, but on the whole it seemed to work well.

Getting towards the end of my set I delivered a short line that looked OK to me on paper but even before I’d finished saying the words I could sense that it wasn’t going to work, so out of desperation I improvised a new punchline and almost wet myself when it got a massive laugh. Then I went a bit meta and told the audience that I should end on that laugh, but I had more material to get through, at which point Kate shouted from the side of the stage “Yeah, Lance, you’re already 13 minutes into your 5 minute set, so if you could make it quick…”

This threw me off balance a little. I knew I was over 5 minutes, but 13 seemed a little gratuitous, and at a real-world open-mic going over time is a big faux-pas, so I made a very clumsy link to my closer, delivered it less than smoothly, and got a fairly mediocre laugh for it. Lessons: time my material better and, if I get an opportunity to finish on a big laugh, take it and be grateful.

I got off the stage and watched the final act. When it was over all I really wanted to do was go for a drink and a debrief with the other acts, but we each had our own friends and family waiting to talk to us, and it was already getting close to last-train-home time.

The next morning our WhatsApp group was buzzing with conversation about what to do next, and this made me happy. After getting off stage I knew I wanted to do more, hit some real open mics, try my stuff on tougher audiences, deal with some hecklers, and I was glad that some of the others were up for the same.

Maybe I should have just started going to mics to being with, but the course did what I needed it to – got me over my inertia and gave me a hunger to get on stage again, and it helped me make a handful of friends with the same idea.

Right now my plan is to do at least one open mic spot a week, more if I can – but we’ll see how that works out in practice.

Getting started in stand-up comedy – the course

I’ve always loved stand-up, but for a long time I never imagined it was something I’d be able to do. I know I can write funny material (my first job was as a reviewer for video games magazines, back when the industry had a sense of humour) and I can always make people laugh in the pub or round the poker table but, as a natural introvert, the idea of standing up in front of an audience horrified me.

As I got older I had to do more public speaking in my career and, while I still think of myself as introverted, I’ve learned to be extroverted in short bursts when the situation demands. It takes a lot of mental energy and usually wipes me out for a day or two, but I kind of enjoy doing it, and I eventually started thinking that I might make a passable stand-up comedian.

Why would I even want to be a stand-up? All the usual reasons – if you put together a list of all the cliches about what drives people to stand-up comedy, I would probably tick every one of those boxes.

I’ve been circling around the idea for a few years, but life kept getting in the way and I never got round to starting, so at the beginning of 2017 I promised myself that one way or another I’d get on stage by the end of the year. Spring arrived and I still hadn’t got my shit together enough to do an open-mic night, so I decided to book myself onto a stand-up comedy course.

I didn’t really want to do this, because all the advice for aspiring stand-ups that I read said the best thing to do was just start hitting the open-mics and learn from experience, but I felt like it would give me the momentum I needed to get started. The course, run by City Academy, was the only one I could find that was taught by an established comedian who I’d heard of, Kate Smurthwaite. It ran over six weeks and ended with a showcase night in a real comedy club with an audience guests invited by the students – so it seemed ideal.

I was on the course with 9 other wannabes, and the weekly lessons (held on a Wednesday evening in a studio at the back of a theatre in Soho) were good fun. There was an interesting mix of different ages and motivations amongst the other students, some wanted to be stand-up comedians, some wanted to improve their confidence and public speaking ability, others just thought the class would be fun but had no plans to continue comedy afterwards.

At the risk of sounding like a dick, I’d already spent a couple of years hoovering up books, articles and podcasts about stand-up (not to mention watching a lot of it) so I was already familiar with a lot of the stuff covered by the course, but it was still good to talk it all through with a professional comedian. For me, there were two main things I wanted to get out of the course:

  • The showcase night – to try stand-up in front of a relatively tame-crowd for the first time
  • To meet some like-minded people who would be up for hitting the open mic scene once the course was over

What I liked about the course was how it brought everybody along, regardless of ability. Right from the beginning some of the students were clearly going to be good at this, while I had strong doubts about some of the others. But by the end of it, every single one of them put together a set and performed it in front of a room full of people, and they all got laughs.

For me, it was all about finding a way of getting started instead of just daydreaming about being a stand-up, and it definitely helped with that.

How I got a PR agency to the top of Google’s search results

In January 2014 I started work at the financial and corporate PR agency, Hudson Sandler, as head of digital. One of the projects I worked on there was revamping the agency’s website, which was sorely out of date and failing to generate any inbound sales enquiries because it was not appearing in search engine results for any relevant terms.

I started work on this project in autumn of 2014 and by the time I left the agency in summer 2015, the website was on the front page of Google for many relevant search terms, and right at the top of the results for key terms such as ‘financial PR agency’ and ‘corporate PR agency’. During that period the monthly traffic increased exponentially and the site began generating lucrative sales leads for the agency.

My budget for this project was £0, and there are dozens of much larger UK agencies competing for those search terms.

So how did I do it?

The first step was to move the site from static HTML pages to a content management system that would make it easy for us to add and edit content, so we migrated the old site to WordPress with a modified off-the-peg template to match the agency’s branding. I also installed an SEO plugin which automatically generated sitemaps and allowed me to manually edit page titles and meta-descriptions.

Next I overhauled the site’s static content. PR agencies tend to favour fluffy, strategic sounding language which is absolutely no use for SEO purposes – search engine algorithms aren’t good at deciphering marketing doublespeak. So I rewrote as much of the content as possible with clear, descriptive copy about the agency and the services it offered. I also made sure that the site had plenty of internal links with descriptive anchor text.

In addition to the static content I introduced a blog to the site so we could regularly post updates about the agency and thought leadership pieces, this was central to the whole approach. Over several months we wrote a lot of blog posts that were tightly focused on our key subject areas of financial and corporate PR. This doesn’t mean churning out copy stuffed with keywords, but simply that the articles were all specifically about different aspects of the topic at hand.

This meant that when Google’s algorithm looked at our site, it would find lots of content and language that is highly relevant to that topic. It was also important that the blog posts were genuinely useful and interesting for the target audience for a couple of reasons:

  1. This would increase the chances of them being shared on social media and linked to from other sites, which is good for SEO
  2. If the articles are of poor quality visitors will not spend very long on the page, and this can have a damaging effect on the site’s performance in search engines

I also made a point of writing lengthy blog posts of around 1,000 words or more where possible, because most SEO experts believe that longer articles are better than 400/500 word blogspam. Writing a lot of good quality, on-topic, long-form blog posts is hard work, but there are no shortcuts here, your site’s search engine rankings depend on great content, so you need to put the effort in. The results we achieved prove the value of that.

Having fixed the site’s structure and greatly improved the quality of content, there was one final piece of the puzzle to solve; backlinks. Your site’s SEO is highly dependent on both the number and quality of links pointing to it from third party sites. In short, you need as many links as possible from high authority sites (i.e. websites belonging to established media, big corporations, government, academia and other respected sources) and this is very hard to achieve.

This is where we relied on good old fashioned PR skills to charm and persuade people to link to our site. We asked clients to link to us from their online press centres, we created stories which gave the trade media good reasons to write about us, and we came up with a few other creative ways of getting links from authoritative third party sites. As with the content, there are no shortcuts here any more; if you want good quality links to your site, doing the legwork is the only way to make it happen.

And that’s pretty much the long and short of it. Using Google Search Console we were able to track how our site was appearing in search results and we noticed an almost immediate improvement, but it took a couple of months before we started to see our site at the top of the results for relevant search terms. Over time, as we added more content and secured more links, the results got better and we began to inch out major competitors for our most important search terms.

If you take away anything from this story it should be this – everything I did was relatively simple. Sure, it’s hard work to create a pipeline of good content and to get lots of quality backlinks but there’s no dark art to any of it, you just have to put the hours in.

How I built Conway’s Game of Life in JavaScript

EDIT (MAY 2016): Since writing this post in July 2015 I noticed it’s started to get a bit of traffic from Google. If you’re just interested in the end result, here’s a JSFiddle of my final version of Conway’s Life.  That version has cleaner and more slightly more optimised code than shown here. Original post below:

I’ve recently been focusing on strengthening my JavaScript skills. I used a few JS snippets when I built Influential Blogs a couple of years ago, but it was mostly code I cut and paste from the web to solve specific challenges – the bulk of the site was built on PHP.

The best way to learn a language is to build stuff, so the first challenge I set myself was to build a version of Conway’s Game of Life. It’s a simple concept; the game consists of a grid of cells, each of which can be alive or dead. For every cycle of the game, the cells can be turned on or off based on the following rules:

  • If a dead cell has exactly three live neighbours, it comes to life
  • If a live cell has less than two live neighbours, it dies
  • If a live cell has more than three live neighbours, it dies
  • If a live cell has two or three live neighbours, it continues living

By repeating the cycle over and over, these simple rules create interesting, often unpredictable patterns. I was fascinated by the idea as a kid and wrote a few versions of it in Basic on my ZX Spectrum, so it seemed like a good place to start with JavaScript.

Step 1 – Creating the grid

The grid of cells needs to be stored somewhere, so my first job was to create a two dimensional array. This was an instant stumbling block because I learned JavaSript does not support multi-dimensional arrays. However, I learned I could solve the problem easily because each element of an array can be any type of variable, including an array so, for example, I could create an array of 100 elements, and each of those would contain another 100 element array, which would give us a 100 by 100 cell grid to work with.

function createArray(rows) { //creates a 2 dimensional array of required height

var arr = [];

for (var i = 0; i < rows; i++) {

arr[i] = [];

}

return arr;

}

This function returns an array with n elements and places an empty array in each of them using a FOR loop. We don’t need to worry about specifying the number of elements in those sub-arrays, because JavaScript lets you dynamically add new elements to an array. This means we can simply add as many variables as we need when we populate the grid.

We can now create our grid by calling this function and assigning its output to a variable:

var theGrid = createArray(gridWidth);

gridWidth is a variable defined earlier in the code simply stating how big we want our grid to be – I wanted this to be easy to change because I didn’t know at this stage how quickly the game would run with large grids.

Step 2 – Populating the grid

For the sake of simplicity I wanted the starting game state to be random. So I wrote this function to randomly populate the grid array with ones and zeros, live or dead cells. Since the theGrid is a global variable (more on this decision late), we don’t need to pass anything to this function or return anything from it, we just call it directly after we have created the array.

To make this work, I had to learn how to do random numbers in JavaScript. Math.random() returns a floating point number between 0 and 1, so I poked around on StackExchange to learn how to convert that into the nice clean 1 or 0 that I wanted to fill each cell with.

function fillRandom() { //fill the grid randomly

for (var j = 0; j < gridHeight; j++) { //iterate through rows

for (var k = 0; k < gridWidth; k++) { //iterate through columns

var rawRandom = Math.random(); //get a raw random number

var improvedNum = (rawRandom * 2); //convert it to an int

var randomBinary = Math.floor(improvedNum);

if (randomBinary === 1) {

theGrid[j][k] = 1;

} else {

theGrid[j][k] = 0;

}

}

}

}

Step 3 – Drawing the grid on screen

At this stage I had only really learned core JavaScript and didn’t know anything about Canvas, other than I should probably use it for any kind of graphical output. I needed to write a function to draw each grid cell in the array as a pixel on a Canvas, so I asked the internet how to draw a single pixel on a Canvas, and then cannibalised that code to work with my drawGrid function. I hard-coded the Canvas size to 400 by 400, because I didn’t envisage using a grid larger than that and I could use a smaller grid without changing the Canvas dimensions.

function drawGrid() { //draw the contents of the grid onto a canvas

var c = document.getElementById(“myCanvas”);

var ctx = c.getContext(“2d”);

ctx.clearRect(0, 0, 400, 400); //this should clear the canvas ahead of each redraw

for (var j = 1; j < gridHeight; j++) { //iterate through rows

for (var k = 1; k < gridWidth; k++) { //iterate through columns

if (theGrid[j][k] === 1) {

ctx.fillStyle = “#FF0000”;

ctx.fillRect(j, k, 1, 1);

}

}

}

}

Step 4 – Update the grid

Now I’ve created a grid, randomly populated with living and dead cells, and drawn that grid to the screen. The next thing I need to do is apply the game rules to the current grid state, switching the cells on or off as required to create the subsequent state. This is the main chunk of game-logic.

It was easy enough in theory: we simply look at each element in theGrid array, count up the number of live cells around it (each cell has a total of eight neighbours which could be dead or alive) and then use that total to decide whether the current cell lives or dies.

The problem this creates is that you cannot update theGrid array as you’re doing this, because if you change the state of a cell that means the you’ve changed the state of the grid before you’ve finished updating all of the other cells.

The way I tried to get around this was by reading the current state of the grid from the Canvas, so I could update theGrid array whilst referencing the as-yet unchanged game-grid on the screen. Simple, update the entire array, redraw the Canvas, repeat.

I learned that the Canvas method, getImageData(), would allow me to get the current state of each pixel in the grid, so I used that to calculate the total number of live neighbours for each cell. I thought I was being clever and efficient by using this approach – I was wrong. It turns out that reading from and writing to the Canvas is relatively slow, and even using this approach for a small 100×100 grid was clunky, with maybe one or two updates per second.

So I switched to the obvious alternative – using two arrays: theGrid holds the current state of the game board, and a second array mirrorGrid is used in the update function to store the new state of the board. Once the board has been completely updated, the contents of mirrorGrid are copied to theGrid ahead of the screen being updated. The performance was instantly and significantly improved – even on a much larger grid the update cycle ran at least ten times faster.

Here’s the function which performs this:

function updateGrid() { //perform one iteration of grid update

for (var j = 1; j < gridHeight – 1; j++) { //iterate through rows

for (var k = 1; k < gridWidth – 1; k++) { //iterate through columns

var totalCells = 0;

//add up the total values for the surrounding cells

totalCells += theGrid[j – 1][k – 1]; //top left

totalCells += theGrid[j – 1][k]; //top center

totalCells += theGrid[j – 1][k + 1]; //top right

totalCells += theGrid[j][k – 1]; //middle left

totalCells += theGrid[j][k + 1]; //middle right

totalCells += theGrid[j + 1][k – 1]; //bottom left

totalCells += theGrid[j + 1][k]; //bottom center

totalCells += theGrid[j + 1][k + 1]; //bottom right

//apply the rules to each cell

if (theGrid[j][k] === 0) {

switch (totalCells) {

case 3:

mirrorGrid[j][k] = 1; //if cell is dead and has 3 neighbours, switch it on

break;

default:

mirrorGrid[j][k] = 0; //otherwise leave it dead

}

} else if (theGrid[j][k] === 1) { //apply rules to living cell

switch (totalCells) {

case 0:

case 1:

mirrorGrid[j][k] = 0; //die of lonelines

break;

case 2:

case 3:

mirrorGrid[j][k] = 1; //carry on living

break;

case 4:

case 5:

case 6:

case 7:

case 8:

mirrorGrid[j][k] = 0; //die of overcrowding

break;

default:

mirrorGrid[j][k] = 0; //

}

}

}

}

//copy mirrorGrid to theGrid

for (var j = 0; j < gridHeight; j++) { //iterate through rows

for (var k = 0; k < gridWidth; k++) { //iterate through columns

theGrid[j][k] = mirrorGrid[j][k];

}

}

}
Step 5 – Creating the game loop

Now I’d written all of the main components of the game: create a grid, randomly populate it, draw the current grid state on the screen, update the grid by applying the rules to each cell. What I wanted to do next is run the updateGrid() and drawGrid() functions in some kind of loop so the board would keep updating for as long as I wanted.

At first I tried simply setting up a FOR loop and calling the two functions within it for a hundred or so iterations, but this didn’t work. The code would either hang completely or take a really long time to draw just one frame before hanging. I didn’t understand why the drawGrid() function wasn’t working every time I called it in the loop.

The internet rescued be again and I learned about requestAnimationFrame(), which is ideal for this kind of problem because it makes the browser update the screen whenever it’s called. So, the function to run the game loop infinitely is like so:

function tick() { //main loop

drawGrid();

updateGrid();

requestAnimationFrame(tick);

}

When function tick() is called, it first draws the current state of the grid, then updates the grid, then tells the browser to update the screen and calls itself again to repeat the loop. So the flow of the code goes like this:

  1. Create an array to store the grid
  2. Create a mirror array to use when updating the grid
  3. Fill the grid with random cells
  4. Draw the current grid state to the screen
  5. Apply the rules to each cell and update the grid
  6. Keep repeating the last two steps

You can see the complete code in action here: http://jsfiddle.net/xcs1y127/10/

Obviously there are lots of refinements that could be added, such as allowing the user to pause the game, reset the grid, draw their own patterns on the grid, etc, but at this stage all I really wanted to do is get a functioning version of Life up and running. I’ll add in all the window dressing as my next project.

Performance improvements

The first thing I was keen to do is find out if there were any ways in which I could make the code run faster, so I could use larger grids without sacrificing update speed. Switching to the two-array update approach I mentioned in step 4 really made a huge difference to performance, but I thought I could learn a few things about code optimisation by trying to squeeze any additional performance from my code.

The first thing I learned was that you can use console.time() and console.timeEnd() to find out how much time different parts of your code take to execute, so I tried using it on my functions while I experimented with potential optimisations.

I read that using locally scoped variables in functions is faster than global variables, so I tried making local copies of theGrid array in both the updateGrid() and drawGrid() functions, but this didn’t seem to make any discernible difference to the execution time of either.

I’ve also read an article about pre-rendering to an off-screen Canvas before writing to the on-screen one, as this apparently improves performance, although I haven’t yet tried it as my Canvas knowledge is still shaky.

I was hoping that there would be some easy performance tweaks I could make to the updateGrid() function, as this is clearly where most of the work is taking place, but I’ve not learned anything yet that will help with that.

(EDIT MAY 2016: I tried this off screen rendering method eventually, but it made almost no different to performance. At this stage, the only way I can think of to make a JS version of this game to show significant performance is to use a better algorithm for updating the grid. I recently read about the “List Life” approach, which speeds things up by only updating the parts of the grid which feature live cells, instead of checking every single cell on each iteration. It sounds interesting, but i haven’t had time to give it a try yet. Please let me know if you produce a JS version of this, I’d love to see it. )

The real difference between working in PR and journalism

I’ve been in PR for nearly ten years and was lucky enough to join the industry just as it started to become entangled with digital and social media, which enabled me to carve out a little niche for myself as a digital specialist since I happen to have a bit of experience in the online world.

Before PR I was a tech journalist for 13 years and, to be honest, it still sometimes feels strange not turning up to an editorial office every day.

When people ask me why I made the leap, I usually tell them that it seemed like the most logical progression, but the truth is that PR is a very different world to the kind of tech-magazine journalism I spent much of my life doing. I don’t feel like I made any sort of logical, smooth progression, I feel like I jumped right into the deep end of a completely new career.

The most noticeable change in your day to day life is that people stop treating you like you’re important, but I think all but the most deluded of journos would expect that, so it’s not worth dwelling on. There are other changes that I was less prepared for.

When I was a hack I lived in a little bubble that was protected from any kind of commercial reality, all I had to worry about was producing great articles and meeting deadlines (or at least, not missing them by too much). Most of the tech magazines I worked on had an atmosphere that was somewhere between a playground and a laboratory – lots of smart people in a room together, having fun and challenging each other. The suits always took care of the business side of things for us.

In a PR agency, you’re acutely aware from day one that you need to earn your keep: all that really matters is getting good results for the client and winning new business for the agency. This may seem perfectly obvious, but it can be a serious culture shock for somebody who’s only ever been judged on something as subjective as how well they can write.

When I was a journalist I was largely free to manage my own time as I pleased, so long as I showed up to the office occasionally and the work got done on time. PR agencies require their staff to fill in timesheets to account for every minute of their day because their staff’s time is, essentially, their chief commodity and they need to keep track of it closely. In all honesty, this is the one part of the PR industry I have always struggled to adjust to. I completely understand the need for it, I just hate having to do it.

Journos going into PR at a junior level are probably better equipped for the move, because they are most likely to be focusing on getting coverage and if they’ve got good contacts in their industry they’ll probably do quite well. At the more senior levels, it’s a different game entirely.

Firstly, you have to deal with clients, who can sometimes be difficult and demanding – they’ve invested significant budget in your agency, and they’re depending on you to do a good job, so they’re understandably going to want to make sure you’re doing your best to deliver on your promises, so that they can deliver on the promises they’ve made to their boss.

Secondly, you need to learn a lot more about budgeting and project management. Putting a magazine together has its own challenges, but running PR activities for major corporations requires a completely new skill set.

Finally, you have to learn to pitch and win new business – it’s a steep learning curve, and often requires the same kind of all-hands-to-the-pump attitude that magazines go through on deadline week. It’s good fun though, and the buzz you get from working on a winning pitch is one of my favourite things about the job.

One of the most interesting differences between journalism and PR is the attitude to creativity. All PR agencies strive for creativity, they hold brainstorms and run training sessions and hire consultants to help their teams be more creative, while on all of the magazines I’ve worked for, creativity just happens by itself.

I think the reasons for this are pretty much everything I’ve outlined above – it’s easier to be creative when there’s a distinct lack of pressure in your working environment. Obviously, PR agencies need that pressure, they need to get results for clients, win new business, track their staff’s time and all the rest of it, but ultimately that makes it so much harder for people to be as creative as they could be in a more relaxed atmosphere.

(Image credit: Ritesh Nayak)

Who is Britain’s greatest tech hero?

I recently ran a survey for a client to find out who people think Britain’s greatest technology pioneer is – and since the idea never got used, I thought I’d share the results here. We used Google Consumer Surveys to ask 1,000 UK internet users who Britain’s greatest tech hero is and gave them a list of some of the most obvious contenders, as well as leaving an open option for them to suggest other pioneers.

It’s completely unscientific and just for fun, but I don’t think people would disagree with the findings too much.

Greatest Tech Hero - Overall

It’s hard to argue with Alan Turing taking the top spot, although some might wonder whether Clive Sinclair deserves more votes than Tim Berners-Lee. That said, we shouldn’t underestimate the impact that the ZX Spectrum had on an entire generation of techies, inspiring millions to experiment with their first computers and learn about coding.

What surprised me was that there was such a slim margin between the top four – even today it still seems that people value the early contributions to computing made by Charles Babbage and, to a lesser extent, Ada Lovelace.

The results become a little more interesting when we look at the difference between male and female votes. First, if we focus on the results from the 320 women who participated in the poll we see very different rankings – women really seem to rate Sir Clive.

UK Tech Hero - Women

Male voters, on the other hand, were more likely to rate Alan Turing as our greatest technology hero.

UK Tech Hero - Men

How I learned the importance of backup, the hard way

When I left school my first job in 1991 was a Production Runner for a TV gameshow being filmed in northwest England. This role is TV’s equivalent of an office gopher, and you’re expected to help with whatever jobs the production team needs a spare pair of hands with.

Part of the job was to keep a file of all of the hundreds of people who’d applied to be contestants on the show, and my boss made me painstakingly fill in a paper form for each person and store it in a lever-arch file. This was far too laborious and old school for my 17 year old tastes, so I convinced the grizzled old producer that we should create a database on the office’s solitary PC, which would streamline the entire process.

He agreed, but insisted that I continue with filing the paper forms, which left me tearing my hair out. The stupid old duffer clearly didn’t understand the point of technology was to reduce work, and now I’d ended up adding extra work to an already painful job.

Nevertheless I pushed forward and created the database to demonstrate that it would be more efficient and useful than the paper system, and pretty soon we had a database of hundreds of applicants. The team were impressed to find that it was suddenly much easier to search through the applicants to find the ones with the attributes they were looking for – I took this as a small victory but was still pissed off that I had to keep doing the hand-written forms.

I sulked and complained and repeatedly told my boss it was a complete waste of time writing out the forms by hand when I was already entering them into the database much more quickly. But he was from a different generation and while he admitted that the database was useful, he’d feel more comfortable if we had paper copies of everything.

And then, one day, disaster struck. The team wanted me to help them search for some new contestants through the database of applicants, but somehow the 5.25inch floppy disk which stored the data had got corrupted and everything was lost. I was 17 and this was my first job, I’d never suffered a catastrophic loss of data before, so it had never occurred to me to create a backup. The disk worked and I had no reason to believe it would ever stop working. Nobody had taught me about the importance of backup, so I’d had to learn the hard way.

I felt utterly humiliated. I spent a whole week working late to re-enter the data, and sulkily admitted that my boss had been proved right all along – without the paper copies we would have been screwed. Could have saved myself a lot of trouble by spending ten minutes making a couple of copies of the database.

How to write brilliant long-form blog posts

Image credit: JM3/Flickr
Image credit: JM3/Flickr

If you work in PR or any kind of social media marketing, you probably need to write a lot of blog posts and I’ll bet that most of them are no longer than about 400-500 words. Conventional wisdom is that people don’t read long articles online and this kind of length is ideal for SEO purposes.

That’s not really true anymore. SEO experts largely agree that long-form articles perform better in search engines and, while there are no hard and fast rules, broadly speaking you should be writing at least 1,000 words per blog post to get better results. For more serious, in depth reports, you should be thinking about word counts closer to the order of 3,000.

The idea that people don’t read long-form articles online is also outdated. This thinking harks back to a time long before smartphones and tablets, when people only accessed the web on their PCs. It made sense that nobody wanted to read long articles on their PC screen, but these days people are much more likely to read a long article on a tablet or phone, away from their desk.

The truth is that any idiot can churn out 400 words on almost any topic (although plenty of people still do a terrible job of it). That’s why the internet is full of low-value, spammy content, and the public relations industry is especially guilty of this. We charge by the hour, and good quality content takes time. We give junior execs tight deadlines to write about complex topics which they don’t understand in order to meet targets, and the end results are flimsy blog posts that nobody wants to read.

Writing good quality articles of any reasonable length is a lot harder, you’ll need to go into a lot more detail about the topic and any gaps in your knowledge will become painfully obvious. And that’s really the point here; long form articles tend to be higher quality, not just because they have more words, but by virtue of the fact that in order to write those extra words the author has probably had to do a lot more research, has a better knowledge of the topic, and is most likely simply a better writer.

How PR people get long form articles wrong

Most public relations people approach blog posts in the same way as press releases, which follow the time honoured ‘news pyramid’ format. This starts with a concise, pithy headline, then all of the most important facts about the story in the first paragraph or two, followed by an increasing amount of supporting information, quotes and extra context as we get further into the article.

The problem with this style of writing is that while it works well for news stories, it’s not so good for long form articles. When you get most of the ‘story’ across in the first few lines, it’s easy to run out of things to say and you’ll find yourself padding out the article with pointless filler, desperately trying to hit the wordcount.

A good way to approach long form articles is to turn the news pyramid on its head. Start by outlining the topic, what are the major issues, what’s the background, who does it impact, how is it likely to be relevant to the reader? Flesh out your main points with plenty of context – is there any independent research with statistics and facts you can cite to support your arguments? What have other people said about the same issue? Add in relevant quotes from prominent commentators, experts, and journalists, and consider how their viewpoints could be used to add additional detail to your article. Alternative, conflicting opinions are great sources of additional material and will add balance to your article.

The important point about all of this is that nothing you add to your article needs to be padding – you can always find something else to add value, a little extra information that helps paint a picture or make a point without resorting to unnecessary verbiage. But think again about that inverted news pyramid. As you construct your article you should be moving down from the broad scene-setting and context-adding towards the fundamental point that you want to make.

Planning is essential

When you’re writing longer articles it’s not enough to simply brain dump your thoughts onto the page and then tidy the copy up afterwards, you need to plan the piece out. People in the PR industry talk a lot about ‘storytelling’ and this is where you really need to put that skill into practice.

To start with write down bullet point versions of all the areas you want to cover, then try to arrange them into a logical structure. Does each point flow naturally onto the next, towards the articles ultimate conclusion? Are there any glaring gaps in the flow? If there are any areas where one part of the discussion does not seem to move seamlessly from one point to the next, this is a good sign that there are some missing pieces in your story which need to be filled in, and this will help you add more to it.

Next take a look at all those bullet points and flesh them out with supporting notes. Think about what you’ll need to cover in each of those sections to tell the full story and explain each point clearly. Again, during this process you’re likely to notice things that are missing or don’t entirely make sense, and this will help you to not only get your word count up, but also write a better blog post.

Now that you’ve done the hard work of thinking out the structure and overall content of your post, actually writing the copy should be relatively straight forward. It’s always harder to start with a blank page, after all.

Once the first draft is complete, hopefully you’ll find that you’ve got both a well written article that flows well, and also a high enough word count without the need for any pointless filler material. Read it through, check again if anything’s missing, fill in the gaps. But it’s equally important to remove any fluff that doesn’t need to be there – you might not want to reduce the word count, but let’s not lose sight of the aim, to produce a great article. A higher word count might help with SEO, but consistent writing great articles that are a pleasure to read will help even more. If you have to choose between quality and quantity, the former should win every time.

A newbie stand-up comedian in London, blogging my progress