HTML5 means one thing, and one thing only: games! Okay, that's not true at all. Not even close, but heck - we are seeing stacks of fantastic games emerge, and the buzz that surrounds even the more mediocre efforts is considerable. So where's the love in the HTML5 spec for us game makers? When it comes to defining the appropriate uses for web technologies it's definitely a case of Internet. Serious Business.
Read on for more »

Oh no! My msie.rom file is infected with Trojan.MacOSX.ChinaTalk!
Read on for more »
I've had a few queries about some of the code in my Hacker News bookmarklet - which makes use of some JavaScipt 1.6 & 1.8 features: map; reduce; filter; and forEach (sorry, no love for some or every this post). Superficially these are just array methods that take a function and apply it to each element in the array. More profoundly however, they provide the means to break up wildly different problems in similar ways - encouraging code reuse, providing flexibility, and (arguably) enhancing code clarity.
It does this by establishing an abstraction: creating a language that can be used to describe our requirements. If we think about (or re-think) our problems in terms of this language then it becomes easier to decompose and "mix and match" component parts as needed. It turns out that you can restructure a lot of your code using this simple language.
Read on for more »
Wednesday, April 27, 2011
The map/reduce (and their friends filter, each, flatten etc) paradigm provides a general way to manipulate lists and streams. This is particularly well suited to web work - where we spend most of our days playing with lists of DOM elements. Recent versions of JavaScript give us the tools to do this work natively but before that we had to roll our own, or use a library. jQuery has had some similar features since way-back-when, so today we're going to do a bit of "compare & contrast" on the map function: jQuery vs jQuery vs JavaScript!
Map iterates over a collections and applies a function to each element - returning a new, usually modified, list. Our tests will examine jQuery's "inline" map with it's global $.map map, and JavaScript's native map function. The object (no pun intended) is to see how each implementation varies in terms of the parameters and the value of this we get each iteration, and how they handle weird arrays.
Read on for more »