Encapsulation Part 3: Objects

So far I’ve covered encapsulating arrays but objects are a far more common data type to encapsulate. The basic idea is to allow properties to be set, accessed, checked and removed without giving direct access to the object itself. You’ve almost certainly seen structures like this before. For consistency, setting will return the instance and […]

Encapsulation Part 1: Overview

Encapsulation is one of the four major principles of object-oriented programming (the others are abstraction, inheritance and polymorphism which I might cover in a later post). The basic idea behind encapsulation is to provide access to data while still hiding or protecting it. In this series of blog posts, I’ll show how this is done; […]

Well that surprised me

I recently started work on a web-based app for smart phones. Since it was explicitly for mobiles and explicitly not for desktop devices (and I was building it in my own time rather than for a client) I decided not to use jQuery. I’d read a study that showed how large amounts of JavaScript on […]

Help – I don’t know my JavaScript library!

You may have come across some scripts out in the wild that have different versions available for a few libraries and wondered how it’s done – surely the author didn’t write the same script 5 times, how on Earth would he remember to roll out the bug fixes across all the versions? You may also […]

Simple CSS Transitions

One of my coding heros, Christian Heilmann, recently wrote a new article on Smashing Magazine. The article is a pretty good tutorial for event-driven JavaScript. However, in true-to-myself fashion, I have completely missed the point of that article and noticed one minor thing that Chris did that I think is incredibly cool. Check out his […]

A quick review of SMACSS

If you haven’t heard of this yet, SMACSS stands for Scalable and Modular Architecture for CSS. There have been a lot of people saying a great many positive things about it and I’d just like to add my voice to that crowd with this short review of the book. The printed version of the book […]

How I Learned JavaScript

The thing with JavaScript is that no-one learns it. Everyone just jumps in (these days with copy-and-paste jQuery plugins) and struggles to take that knowledge further and learn more about the language. In this post I’ll describe my the key moments I’ve had (“JavaScript epiphanies” if you like) while learning; hopefully someone looking for the […]