Ajax: beware of crap (again)

Posted on Sun 09 April 2006

A few months ago I've been pointing out an article showing "how easy it is to add Ajax to your app", actually containing lots of pitfalls and guiding readers to "solutions" that will lead them to pull their hairs rather sooner than later.

This happens again, with "Implementing Mutual Exclusion for AJAX". The author explains in great detail the problems with race conditions in multi-threaded applications and how Ajax applications, because of the asynchronous nature of XmlHttpRequest supposedly have to tackle this problem.

He then proposes a mutex class for JavaScript to solve this problem, that will ensure that asynchronous functions will be executed sequentially to avoid race condition. Solving multi-threading issues by sequencing execution. Uh, is that multi-threading? Also, it uses eval'ed strings and pseudo-classes rather than functions and closures.

But the real problem of this article is not there: JavaScript has no threading primitives simply because browsers don't use multiple threads to run scripts! All this stuff is totally useless!!

As a side note, the exact same article was already published in March on developer.com and was criticized on Ajaxian.



No excuse for not buying a Mac

JBoss: is it worth 350 M$?