Archive for January 21st, 2011

Old school meets new school


21 Jan

Here is blog post from what looks like a twitters developer. He’s telling us to be careful when adding event handlers for events that can fire a lot (like window scroll). The problem is that if you load up the event handler with lots of code then the system will become unresponsive because the event is fired too often.

If you have ever written a device handler (once upon a time you may have written a mouse handler just for fun) then you will know that in your interrupt handlers you should do the absolute minimum (like saving the mouse x and y deltas and nothing else). Then on a timer (or even better when when mouse coords are queried) you should do the CPU intensive(r) processing.

I am pleased to see that these old school skill are being invented by the new school programmers.

Stuart McFarlane

Mobile Media Constructs