Saturday, March 20, 2010

Adventures of a developer

It's amazing how much one can learn from very short texts.

I read this post that I had put in my "to read [when you have time to really pay attention and think about what you're reading]" list a long time ago, and was surprised by the amount of content and learning that can be obtained from it. This is a sample of what I'm talking about:

  • Backpropagation algorithms: term taken from Artificial Intelligence, used in this context to trace who clicked on ads, to monitor their effectiveness.

  • Firebug: Firefox extension that allows the user to see and edit (seeing the results in realtime) the HTML, CSS, javascript, etc, of a webpage. You can also monitor requests made by the page, including their response times and responses. Extremely useful for web developers.

  • XMLHttpRequest (also referred to in the post as XHR): type of request used in AJAX to allow for dynamic retrieval of content (without the need to refresh the page).

  • 204 http responses: "No Content" responses for web requests.

  • Accepts header: part of an http request that specifies what does the request expect as a response (if I request an image, I wouldn't expect to receive text content in response).

  • Pixel tagging: one of many ways of monitoring webpage views and user behavior in websites.

  • "Or"-ing functions in javascript: I'm not even sure of how this works, but it seems to be combining 2 functions into one that will be later used to apply both at the same time (a=encodeURIComponent||escape).

  • Regular expressions: (/#.*/, matching "#[whatever]" and /\+/g, matching "+[whatever is in parameter g]", if I'm not mistaken).


Developers who analyze code written by others can also relate to the post because of the way in which Ryan (the author) writes how he arrived at his discoveries:
So I cracked open Firebug, did a search and watched the Console tab while I clicked a link. I was expecting to see a nice little XMLHttpRequest go across the screen… and didn’t.

The always useful trial and error.
A call to clk() in the console tab just returned true, so off to the source for clk() I went. Cmd+U… Cmd+F… ‘clk’…:

More trial and error. "Exploring" a function with quick & easy calls to it. Look for the actual code to understand what it's doing. A bit of developer background to know that he 1) conjured up the source code of the webpage (Cmd + U), 2) wanted to find something in it (Cmd + F) and 3) typed it ('clk'). Also, that he's a Mac user, as evidenced by Cmd and not Ctrl.

Even without understanding the fine details of what Google's doing there, I understand the overall idea, and I'm a bit impressed of how something that looks so "hackish" is at the heart of their ad-monitoring system (I think?).

No comments: