Does IE precompile Javascript?

What's the difference between these two pieces of code:

dojo.addOnLoad(function() {
    dojo.connect(dijit.byId('mainTabContainer').tablist,
       'onButtonClick', tabClick);
});

and:

dojo.addOnLoad(function() {
    var container = dijit.byId("mainTabContainer");
    dojo.connect(container.tablist, 'onButtonClick', tabClick);
});

Nothing I hear you say? Well, I'd guess that as well. After all, the second simply sets a variable that is then used in the following line exactly as it was in the previous piece of code. Yet Internet Explorer (at least version 7 and 8) doesn't agree. It will fail on the second example.

Now my guess is that it is trying to do a pre-compile, and evaluating the first line at parsing, instead of when the function actually runs (which is after the onLoad event triggers). It certainly thinks that the variable container does not contain an attribute called tablist in the second version, but has no trouble finding it in the first. Now all I can say is WTF!?!

Every other browser treats both pieces of code as identical, yet IE consistently fails.

Freedom to work anywhere

In the modern world you may often see busy people sitting in a cafe or airport lounge checking email or updating their Facebook or Twitter status. Just how far the world has come is of no surprise to those of us who are old hands in the work from anywhere stakes. In the days of MySQL AB (now a part of Sun Microsystems, a wholly owned subsidiary of Oracle Corporation) around 70% of the workforce worked from home. In fact, the title of this piece, Freedom to work anywhere, is a direct steal from a MySQL jobs campaign, and I have several MySQL T-shirts with the slogan on it.

Is it important? You betcha it is. With a solid technology base you can easily have a highly motivated (and highly mobile) workforce that will give you far more in output than you have a right to expect, and at a cost that is dramatically lower than the traditional work environment.

Think about it. What is the cost of office space, a desk, chair, air conditioning, lighting, staff amenities, etc, compared to the cost of an internet connection?

With technologies like OpenVPN, IRC, Skype, Asterisk, and of course all of the Mozilla suite of web tools, you can have a distributed and productive work force that can react quickly to demanding schedules and rapid changes in priorities. Your main web server decides to act up during the night? No problem, chances are your head web dev is online anyway or is in a timezone conducive to tackling the problem.

This technology lowers the barrier of entry for startups, allowing them to compete in a global market from day one without having to build the bricks-and-mortar structures of the past before you can attract staff. I notice that an old colleague of mine has taken this to heart, with whatever he is up to at Empire Avenue. Might be worth keeping an eye on these guys.

You really have to wonder about those companies that don't embrace the Work From Anywhere meme, and are stuck in the mindset that predates the modern communication era. (I was going to say it is 20th century thinking, but my first stint of telecommuting was in the 1980's).

I have done my daily work from a variety of places, and solved problems remotely from Lake Tahoe, heaps of coffee shops, and even more recently at 100km/hr down the Western Hwy (no, I wasn't driving). My employer is happy, and so am I.

Book Review: RED SEAS UNDER RED SKIES - Scott Lynch

Title: RED SEAS UNDER RED SKIES
Publisher: Gollancz
Author: Scott Lynch
Edition released: 2007
ISBN: 978-0-575-07925-0
586 pages
Reviewed by: Adam Donnison

RED SEAS UNDER RED SKIES is book two of the GENTLEMAN BASTARD SEQUENCE, following on from THE LIES OF LOCKE LAMORA.

Locke Lamora is a con-man and thief, the consummate Gentleman Bastard. Teaming up with Jean Tannen again for the ultimate con, against the ultimate gambling house, the Sinspire. Jean is the brawn to Locke's brains, and together they get themselves into (and quite often out of) all manner of trouble.

The set up is coming along quite nicely when Locke and Jean are sidetracked, and forced into piracy with a unique and deadly threat. When you don't know how to sail, nor the difference between a binnacle and a barnacle, you know that things are going to get hairy.

In this almost madcap escapade, Scott Lynch has created a rather fun world where Locke and Jean run rampant. The twists and turns, while sometimes comedic, are always entertaining and there were only one or two places where the pace slowed. All in all a great read and this reviewer will be on the lookout for future Gentleman Bastard Sequence titles.

There has to be a better way

Have you ever been in the situation that someone has asked you to just do a little something on their website, and you have to ask the dreaded question "what are the login details?". Chances are they don't know. Some bloke years ago set it up for them, they've got an email from 2006 with something on it, but really, shouldn't you be able to just fix it?

I can't recall the number of times I've had this conversation, and it is always the same. There has to be some way of being able to protect web site owners from these sorts of issues. Websites where the tech contact or worse the billing contact is not the actual owner, websites where the access details are unknown by the site owner, websites where the owner has no idea where they are hosted, or even the fact that they are about to expire.

So what is the problem? Think of it this way, when you bought your house, did you give the builder the title, the keys and set them up as the contact address for rates notices? I'd rather think not, but that is exactly what website owners do every day. In that situation, imagine trying to get a quote to get some extensions done, or get some redress over that rising damp if the builder has gone out of business. The same thing goes with your website. Try getting some additions, or changes done if you don't have access to your site.

In the house analogy there is some protection - a builder has a formal handover to the owner and the title remains with the owner (or the bank, but lets not get too specific about analogies). It is this formal handover that seems to be lacking in the web development sphere. The situation isn't helped by web hosting companies that insist on having different logins for the user account, the website management account and even the support system - how many usernames and passwords does a person need to remember?

Unfortunately I don't have any solutions, but as a web community we need to think about this so that rights are not trampled upon and site owners are not left in the lurch. Some of it may be solved by education, but I think there is a more fundamental problem. Anyone can set themselves up as a website developer, and many do. Setting up a website is simple - but it is just the start of an ongoing relationship with your client. The professional will ensure that the client has all of the details required to ensure that their property remains securely in their hands, while the gifted amateur may produce a fantastic website, but are you going to be able to do anything with it when they move on?

Book Review: The Good Guy - Dean Koontz

Title: THE GOOD GUY
Publisher: Harper
Author: Dean Koontz
Edition released: 2007
ISBN: 978-0-00-722660-3
456 pages
Reviewed by: Adam Donnison

Sitting in your favourite bar, trading sarcastic commentaries on life with the barman, you don't expect to find yourself being mistaken first for a hired killer and in a matter of minutes for the killer's client. Tim Carrier was just having a bit of a lark when the odd man started chatting, but by the time he realised that the man had mistaken him for a killer, he had left with Tim holding an envelope with $10,000 and a picture of the mark. Minutes later the killer then mistakes Tim for his client, and Tim tries to persuade him that the job is off - even giving the killer the money as compensation for wasted time.

Tim then finds Linda Paquette, the intended victim, and tries to warn her, only to find that the killer doesn't take no for an answer and Tim and Linda are set on the run from a man who has far too much information at his fingertips than is healthy.

Koontz does action well. Which is just as well. THE GOOD GUY could use a believable story line as well. Or maybe even just a little less of the formulaic elements like pretty girl in distress, "ah shucks" quiet hero with a history, jingoism, conspiracy lurking in the background, and what is it with American thrillers and cars? Why does the girl have to have a memorable car?

The start is unbelievable. The villain is unbelievable. The ending is painful. The plot predictable. But for all that if you lose yourself in the action it can be a bit of fun.

:: Next >>