Blog Posts

There has already been far too much conversation about whether semicolons are appropriate to use at the end of lines in JavaScript. Serious problems could have been solved in the time JavaScript experts have spent arguing about this. And if the experts can’t make a decision on something as simple as semicolons, what chance do beginners have of understanding JavaScript at all?

Web development is already full of so many variations of ways of doing the same thing, and this is part of what makes our job so much fun - but if you are someone who’s still learning about web development these arguments just makes matters even more confusing.

Often I find myself in a situation where I need to write code for a prototype or proof of concert which will be handed over to another developer. When I write the code I have no idea who that developer is or what their skill level will be.

So my aim has to be to write readable, reusable, consistent code that could be understood by any level of JavaScript developer. Even if they have a fairly basic understanding of JavaScript, they should be able to figure out what is going on. And that includes using semi colons at the end of every line. If you have already written code that is going to take some time to understand, adding further complexity by removing semi-colons from the end of lines isn’t going to help.

And there’s an incentive for me to write readable, understandable code. If I write poorly structured, bad code then I have to spend much longer handing over my code; sitting with the developer; explaining how it works and coming back to answer questions. And I want to work on the next exciting thing. By following an approach that everyone can understand, I’m saving myself time and pain later on.

When you are writing JavaScript, try to stick to best practices and style guidelines such as Rick Waldron’s Idiomatic style guide or Google’s JavaScript style guide, and worry about optimising your code at build time using minification.

Should JavaScript developers know about automatic semi-colon insertion? Sure, it’s good to have an understanding about how it works.. Is it the most important thing for beginners to learn right now? No. Let’s help the newbies by producing code that can be used and understood by all.

And if you are a beginner, then Codecademy is a great place to start learning; and Javascipt: The Good Parts and Eloquent JavaScript should be the top of your reading list.

The Start of Something New

Friday, January 12 2018

After almost 11 years, I am moving on from AKQA to pastures new.

Read more

The Quest for the Perfect Workflow

Friday, May 16 2014

Today I spoke at jQuery UK on my Quest to find the Perfect Workflow. This post provides detailed information; slides and the links to the material mentioned in my talk. Now updated with screencast!

Read more

Creating a List of Posts in Assemble

Thursday, February 27 2014

In the previous post, I showed how to get started with Assemble. Now we have content, let's look at how we can create a list of posts.

Read more

Getting Started With Assemble

Wednesday, February 26 2014

Want to create a static site blog with Assemble? You've come to the right place. This in-depth tutorial will get you started with creating a blog in Assemble!

Read more

Shrinkwrap Your Dependencies

Wednesday, February 5 2014

Front end development has evolved over the last couple of years thanks to `npm` popularised by task runners such as Grunt and Gulp. Thanks to our package.json files, it's easy for another developer to get set up on our project in seconds by typing `npm install`. But what happens when some time has passed and your project dependencies have moved on? A new version of a package may introduce a new bug, or completely change its functionality altogether.

Read more

Beginning Web Development

Tuesday, January 7 2014

There are so many things to learn in web development now that it can feel incredibly overwhelming - but it can also be very rewarding. What fascinated me about web development was the ability to create - I love to create - and when I started out building web pages I found it incredibly easy to express my creativity with HTML and CSS in just a few lines of code. Here's some tips for if you're just starting out!

Read more

jQuery On and Off Namespacing

Tuesday, February 5 2013

Being able to apply and remove events with `on()` and `off()` is great, but sometimes there is a requirement to either trigger or remove a subset of events that have been added to an element. Here's how!

Read more

Sublime Text 2 Cheatsheets

Monday, December 24 2012

As my Christmas present to you, here are 2 cheatsheets (one for Mac, one for Windows) so you can learn and reference those shortcuts to improve yourself and your developer skills.

Read more

Canvas Animated Particles 3D Effect in 5 Minutes

Sunday, December 23 2012

A couple of months ago, I gave a PechaKucha talk about creating a 3D animated particles effect with the canvas element.

Read more

Extending getUserMedia With Canvas

Sunday, July 1 2012

Following on from my previous post which introduced us to getUserMedia, I wanted to share two ways you can extend getUserMedia's video capture using my good friend, the canvas element.

Read more

Introduction to getUserMedia

Saturday, June 30 2012

For a long time in the 'Flash vs HTML5' comparison arguments, one advantage Flash had was the ability to capture audio and video from the users computer. With upcoming browser releases, it is now possible to do this with JavaScript and the HTML5 video element, and its very simple to do.

Read more

CSS3 Flexbox Carousel

Friday, May 25 2012

Carousels are one of the most common components web developer's build. As other trends come and go, carousels tend to stay.

Read more

State of the Browser 2012

Monday, April 30 2012

A rainy April Saturday in North Greenwich (London) was the host of this year's State of the Browser; where a representative from four of the five browser vendors spoke about how their browsers have progressed in the last year and what we have to look forward to going forward.

Read more

Scaring Off Beginners

Friday, April 20 2012

There has already been far too much conversation about whether semicolons are appropriate to use at the end of lines in JavaScript. Serious problems could have been solved in the time JavaScript experts have spent arguing about this. And if the experts can't make a decision on something as simple as semicolons, what chance do beginners have of understanding JavaScript at all?

Read more

Complying With The EU Cookie Law

Thursday, April 19 2012

The cookie law is a new EU privacy legislation that requires websites to provide clear and comprehensive information about the cookies being stored; and obtain consent from visitors in order to store or retrieve any information about the user.

Read more

Thoughts on Implementing Responsive Design

Monday, March 19 2012

Responsive design is the latest buzzword in a long series of web buzzwords which has featured 'XML', 'Web 2.0' and 'HTML5' to name a few; but it's one that shouldn't be dismissed.

Read more

CSS Regions

Tuesday, March 13 2012

Currently if you have a page where content is separated by a drastic change in layout you will need to include part of your content inside one element, and the other part inside another element. If you're using a CMS, this means you need to have two content fields for what is essentially related content. CSS Columns already offers functionality to separate content in to columns but CSS Regions provide greater control and flexibility of content on your page by allowing content to flow through the page structure, whatever that structure is.

Read more

My JS1k 2012 Entry

Monday, February 27 2012

This year I decided to enter the JS1k competition for the first time. The idea behind JS1k is to produce a cool JavaScript application in under 1kb (1024bytes) of code. I had not done any JavaScript golfing before, so I thought it would be a nice little challenge for myself. I didn't realise at the time quite how addictive or time-consuming JavaScript golfing was going to be!

Read more

CSS3 Backgrounds of the Future

Monday, February 13 2012

Whilst we've been busy supporting older versions of Internet Explorer, a few new CSS features for backgrounds have sprung out of the woodwork and in to our browsers.

Read more

jQuery UK 2012 Conference

Saturday, February 11 2012

Yesterday I travelled to Oxford to attend the jQuery UK conference, which the team at White October carefully crafted together. The snow threatened to stop me, but thankfully calmed down by the morning. So a quick hop, skip and jump on to a train and coach; and I found myself in Oxford at the Saïd Business School.

Read more

Modernizr Prefixed

Saturday, February 11 2012

There was a new release of [Modernizr yesterday (2.5.1), and included within this release was some brand new features to the Modernizr Prefixed() API (introduced in 2.0), which can take away some of the pain of vendor prefixes from your JavaScript.

Read more

Keeping It Real Simple

Monday, February 6 2012

Last week I had the opportunity to go on a presentation skills course, and one of the tasks we were set was to explain one aspect of our job role to a group of people who had no experience in our field using the LIONS approach using zero jargon.

Read more

Impress at Presentations with Impress.js

Tuesday, January 31 2012

The other day I mentioned on Twitter that I was playing around with Bartek Szopka's Impress.js library to write a presentation and it seemed to gather some interest. I then gave the presentation, and that gathered some more interest; so I thought I would write a short blog post about how to use Impress.js.

Read more

Writing for the Web

Wednesday, November 30 2011

Today is Blue Beanie Day, an anniversary where developers change their avatars to wear blue beanies to show their support for web standards. Today is also the day a new web initiative has been launched called Move the Web Forward, with a simple goal of making it easy for developers to start contributing to the web platform.

Read more

Using jQuery .on() and .off()

Thursday, November 10 2011

With the release of jQuery 1.7 on November 3rd came two new ways to attach event handlers - .on() and .off(). These two additions unify all types of (good) event handling in jQuery and will help you write tidier and more efficient code in the future.

Read more

Front End Code Etiquette

Wednesday, November 2 2011

One of the most interesting parts of working as a web developer comes from making a decision on how to organise code depending on a particular project or problem. There are multiple ways to do the same thing, and there's not necessarily a wrong or a right answer for every situation.

Read more

Self Executing Anonymous Revealing Module Pattern

Thursday, October 27 2011

I thought as a way to kick this blog off I would share this JavaScript pattern with you which I've started using recently. I can't take any credit for this pattern - I discovered it on my Internet travels, so all thanks and kudos go to Elijah Manor on 'Enterprise jQuery'.

Read more

Welcome

Friday, October 21 2011

If you're reading this, you've reached the first post of my blog. Depending on whether I've written a few or many blog posts at this point, this may be an achievement that you've reached this post, or it may have been a simple slide of the finger.

Read more