Tuesday, June 21, 2011

First Post (for it, not me)

This is the first message processed by the distributor, as shown by the admin web interface, although a bug in the code has prevented the 'value' column from having any on screen. (it's there in the datastore, though) This is what software looks like when it's barely working.

First Post!

It will be interesting to compare this screenshot with what it eventually becomes, like baby pictures. My programmer's view of proceedings is quite a bit different, and tends to look like this:

The way I see it

It's the debugger console inside Google Chrome, although you'd see much the same thing in Firebug or, I hope, IE's new debugger. This is the 'command line' hidden inside every browser. Learn it's secrets.

Here is my debug function to help you along. It took me quite a while to get it right, and handle all the stupid browser cases. Anything less than these checks (like using console.debug() directly) means your code works fine on your machine, but instantly fails when run on any browser that doesn't have a debugger installed.

// system-wide debug function
function _debug(x) {
  try {
    if(typeof console !== 'undefined')
      if(typeof console.debug === 'function')
  } catch(err) { }
I like to invoke it in code like this:
_debug(['function i am in', that_thing, other_thing]); 
In order to get a bunch of useful things on one log 'line'. Much more useful than message boxes, and it doesn't matter if I forget, and leave the debug statements in. If the user doesn't have the console open, they won't see the messages.

It's fun to have the console open (especially the network tab) when going to major sites like Facebook and GMail. You can watch all the AJAX calls, and see where your bandwidth is going. Some sites are elegantly efficient in their data transfers. Others are more like a swan... all stately grace above the surface, but with furious feet paddling away underneath.

One thing you'll quickly see, none of the major sites are passive 'ol HTML pages anymore. The pages watch you back.

They know what you've been browsing, they know when you're awake.
They know your language and your zone, for the interface's sake.

No comments:

Post a Comment