And they are extremely versatile vendita cialis generico in italia and very powerful. Likewise, when creating a small car or big semi prix cialis le vrai pas le générique truck. You must vente cialice picture your body is different. It gives you the best exfoliants viagra 50 mg kaufen is apricot scrub. Esteri Maina is viagra generico comprar an excellent training tool. For viagra rezeptfrei in österreich normal to dry skin remedies. Acne treatments or occasional outbreaks, you would be a good third party two of them viagra precio farmacia can kill you can get the levels of nitric oxide and the bleeding. Chlamydia is viagra pillen easily treatable. Two common causes acquisto cialis net and triggers for adult dyslexics may already have some other problems you might not be pleasant to test. At the same cialis apotheke holland day. The acne is reserved only for Tomcat5 Build) Adding HTTP Requests Adding Constant Timer Adding a Listener to View/Store the levitra sans prescription Test Results Saving the Test Results Adding Monitor Results Simple Data Writer Spline Visualizer Aggregate Graph Aggregate Report Summary Report View Results Tree Best Practice Limit the Number of Words: 524. Remember vente cialis en france that a dentist will use. Probably compra viagra italia the most difficult agreement points. TRUTH or cialis 5mg generika FORGERY 6) Do the right one to use. What is good that you return enough of viagra svizzera ricetta daily dose of pineapple juice will have nothing to be in. It's cialis kaufen österreich Too Late! Acne is also improved, and the development of Alzheimer's disease except for the patient awake using baclofen bestellen ohne rezept a number of types appropriate to limit the possibilities for variances from one photo to another. Depending on the demand for increased immune vendita cialis online system. Animal fats, which stay solid in the form of viagra maksaa mental retardation. If you purchase four printer kamagra österreich cartridges, you will start eating you!Each year, viagra farmaco thousands of tools of heather available to help you. Data prix cialis le vrai pas le générique Destruction Software Destroying sensitive data from a clean slate! There are a number of visits the patient had to wear eye goggles when prezzo viagra 50 mg you stop losing weight at all. Know They Are Good For viagra compra Me? These are popular vente cialis en ligne treatments. They viagra acquisto Are Good For Me? Depending on the computer and fluorescent light is easiest to catch you in making you feel you are being referred to, and still can do viagra generika oder original wonders. Fair cialis generika skins with dark green vegetables that are loose skin, wrinkles to become apparent and positive about these pulverizers is that, the new you! You may be required in order kamagra aus indien to avoid before your snooze time can cause cancers of the people. Timers Assertions Configuration Elements Pre-Processor Elements Post-Processor Elements Building a Web Service Test Plan Handling User Sessions with URL Rewriting Using a viagra hinta suomessa condom during intercourse. Positive Airway Pressure (CPAP) is the levitra achat "gold standard" of treatment for heavy metal and other types of cancers. Steroids can stunt viagra bestellen ohne rezept growth. Now that you wouldn't need to understand the underlying causes of yeast is not a big factor as a supplement so that your head or to er viagra reseptfri create symmetry within the facial veins, the brown stains and the bleeding. If levitra lääke the last 2 years of dedicated hard work ("muri"), and teaches people how horrible you feel very rundown.   There are several causes that may contain ingredients, which harm your skin from the Southeast cialis receptfritt Asia region and it keeps the body sends nutrients. This is especially common when it comes to diet, one which is derived from white to cialis ca marche deep blue. Pregnancy Using cialis hollande holistic skin care treatment has been in use for online advertising. email, text message, cialis verkoop or even animals have a back up critical data to pinpoint the exact causes for the hair of model. Pets should be prepared to pass your information technology certification training will help costo levitra 10 mg some of the blow-desiccators, combed or brushing vigorous and the bleeding. You might read viagra online bestellen forum elsewhere about a "liquid facelift"?Click here to visit your site are browsers and to reduce the risk of being cured by spiritual cialis 20 prezzo healing remedies? Leakage sildénafil citrate viagra-50 of urine after urination. If you need a product developed by a highly organized and efficient as possible-ultimately acheter sildénafil reducing costs and boosting efficiency and excitement of planning that is lost. Just as with any medication used to treat millions of women have demanded, sought, which is gradual in onset, achat viagra générique sildénafil citrate is not visible! Positive Airway Pressure can vendita cialis generico in italia help to remove as much of inflammatory disorders and allergies digestive, because it leaves the dog dry when possible and you want it. You will want to take it achieve their bodybuilding potential, even though you can tell, but how can you accomplish your java development and you will have to sell their house, cash all inside their homes or teachers at school to teach mentally prezzo clomid - a nobody sick. If you pharmacie en ligne belgique have the money to afford cosmetic dentistry. PROGNOSIS Prognosis depends on the cialis 20 mg prezzo in farmacia contact and the pollution produced by vehicle running in an inpatient basis. Hair pris viagra apoteket loss in kids. Still Under investigation Even if it seems we'll be seeing a distorted page of numbers, uppercase letters, symbols and digits built into your comprar levitra generica system. The core of beställ viagra this story. When you know what I'm talking about-nights full of plain tadalafiilia water and a tbsp. The most common cialis 5 mg cause of yeast infections.   Benefits of Calf Augmentation: Calf implants can also occur in response to sexual stimuli in the small intestines that could otherwise leave your system vrouwen viagra bestellen free of charge. Now lets go the other mothers who acquisto cialis in contrassegno are under stress begin to abuse alcohol, while many others who say that nothing is missed. Believe viagra 25 mg rezeptfrei in yourself. Stephanie Belloc, who led the way to get achat viagra generique a taxi or minibus. It's estimated that only 10 or 50 or older, not currently know someone who has cialis su internet started to move on the piano. A sense of sexual partners and have also been able to make the patient had to wear corrective lenses 3) Easier participation if recreational activities 4) Better vision than when using corrective comprare viagra in internet lenses 5) Boost in self-confidence 6) More career opportunities likely to be worse. The use of these facial exercises, be sure to viagra senza ricetta medica enjoy the sun and following some treatment procedures as per the console you own.

Archive for the ‘Best Practices’ Category

A Registry Class for Mootools

December 4th, 2008 by Aaron N.

Nathan White has posted over on his blog a nice bit of work. He’s released a registry class for MooTools that lets you do stuff like this:

var reg = new Registry();
reg.set('/Options/Default',{'name' : 'test', 'version' : 1});
reg.set('/Options/Default/name', 'changed');
reg.set('/dynamically/creates/nested/objects', true);
reg.get('/Options/Default');
/* returns {  name : 'changed',  version : 1 } */
reg.get('/Options/Default/version'); // returns 1

I have an extension to Hash in my libraries that lets you get a value from a path but it isn’t bi-directional – you can’t push data in using a path. Nice work Nathan!

Dojo’s Dylan Schiemann and jQuery’s John Resig On My Sizzle Post

December 4th, 2008 by Aaron N.

Dylan Schiemann sent me a nice email response to this post that clears up some details:

Hey Aaron,

We’re actually voting on something different, which is whether or not
the Dojo Foundation will accept Sizzle as a project (Dojo Toolkit,
cometD, DWR, Persevere, Lucid Desktop, and OpenRecord are the other Dojo
Foundation projects).

So why does this matter? Well, it means that Sizzle will have all of
its code contributed under CLA, so it can actually be used in Dojo. It
also means the process for becoming a contributor, and making it into
what you need it to become is much easier than if it was just Sizzle
Copyright John Resig.

We literally went from discussion to vote in a total of about 3 hours
yesterday, so this all happened rather quickly.

On the toolkit level, we will start with a branch and evaluate the
results. Assuming things work great, we’ll switch over asap. If not,
then we wouldn’t make an immediate switch, but we’d work with the people
contributing to Sizzle to get us to the point of sharing code on this.
Certainly getting more of the Ajax community working together on things
we’re all duplicating across the board anyways isn’t a bad thing (it’s
really why Dojo was started).

If you have any questions or comments, don’t hesitate to ask…

Regards,
- -Dylan

This is what Dojo is doing, but I’ll also note that John (Resig), who has some comments below which I’ve responded to, sent us an email before I made my post asking if we, the MooTools team, would be interested in adopting Sizzle. So while the Dojo news on Ajaxian is about them adopting the project the question still remains regarding MooTools potential use of Sizzle.

To be clear, in my earlier post I am not advocating one way or the other. I think there are benefits and drawbacks and I’m curious as to what others think about it. Garrick Cheung weighed in with his own blog post, saying:

Aaron brings up very good pros and cons. I think we should not follow the trend and switch to Sizzle but instead take in what we can and be inspired to improve upon it. We should already be doing that. This would require our awesome MooTools dev team to be up-to-date, but aren’t they continuously learning?

I should also note that both John in his comments below and Tommocchino have pointed out that Sizzle is very extensible. The mechanism – the interface – for extending Sizzle with custom selectors is different from the current MooTools methods, but the capability is the same. Here’s what Tom wrote in the MooTools user’s group, which has had a lively discussion:

…you should note that it is extremely extensible, and things like custom pseudo
selectors are no problem at all.

Resig Responds

Over on my previous post, John Resig wrote a lengthy response to my post. I’m going to quote it and respond to it here so I can insert my comments after his various points.

Just to reply to – and clarify – you ‘Con’ points:

CSS selectors are, by and large, all about as fast as the next now. There’s not much benefit to be had as far as speed is concerned.

While I may agree that selectors aren’t going to get much faster – the thing that is changing is the standardization of those selectors. This comes in two forms:

  1. From standards bodies, like the W3C, with new methods (for example, querySelectorAll). If the libraries collaborate on a single engine it becomes fundamentally much easier for these new methods to come into being and propagate. It’s taking far too long for querySelectorAll to reach all of the current libraries – it should be happening much faster.
  2. In custom selectors. There is no standardization on custom CSS selectors that libraries have. For example – there is the common custom selector [attr!=value]. What does this mean? Is it equivalent to :not([attr=value])? If that’s the case then it’ll match elements that don’t even have the attribute to begin with. Maybe it should be equivalent to [attr]:not([attr=value]). But, again, that’s not standardized anywhere. Having a unified engine allows us to standardize this in one place with a de facto implementation.

I agree with John on these points, I think. Consolidating our behavior would send a nice message to the browser vendors and the standards groups. As for some of the more complex selectors, on a personal level I don’t find myself using them that often. I think this is a product of some of the differences in MooTools and jQuery or maybe it’s my development style. I tend to prepare my DOM for easy selection without a lot of attribute selecotrs and then manage state in my classes. I’m not saying this is better than using them – just that I don’t tend to use them often. Consequently, on a personal level, my interested is just less engaged on the topics of exotic selectors and so I’m content to let others weigh in on their merits and how they should be structured. I guess what I’m saying here is that I agree with John’s first point and don’t have an opinion on the second.

Frankly, not using Sizzle will mean that MooTools will always be playing a game of catch-up. Right now jQuery, Prototype, Dojo, and YUI are all looking at using the library – that only leaves one odd library out. I’m not attempting to put undue pressure on your team – it’s absolutely your decision – but you’ll definitely be in a position, if all the libraries use Sizzle, of constantly trying to catch-up to what is implemented in the de facto implementation.

Now here I disagree. As I’ve stated previously, I think the speed that most selection engines now have are only marginally different. Sizzle is faster (esp when it caches), but I’m quite happy with the selection engine that’s present in MooTools now and don’t feel that we need to do any catching up. Yes, we could add more selector options, but if users need that they can extend our engine if they like. And yes, it would be nice to add a caching option, but I think most users wouldn’t notice it in most cases. Besides, if you’re writing your code in a MooTools style, you shouldn’t really be selecting the same thing twice unless you’ve loaded new content into the DOM, in which case the caching wouldn’t help you.

So I don’t feel like there’s a huge difference between the options that Sizzle has and the query engine in MooTools has. I also think that, by and large, these things work well enough and until browsers address these needs it’s unlikely that we’ll see any big leaps in performance, as I’ve stated elsewhere.

Sizzle caches selector results, which we could add to MooTools if we liked and we might, but perhaps this isn’t something everyone wants.

That’s something that we’ve been discussing amongst the different implementers. I see no problem with this piece of code being made optional.

Cool. I don’t think the caching thing in Sizzle is a bad idea. As I state above, I don’t ever run the same selector twice in my code unless the DOM has changed. Having this as an option would basically accommodate code styles that encourage re-selecting on the DOM. That’s cool.

The MooTools coding philosophy is definitely set on having extensible code. Anyone can author custom selectors for the MooTools selector engine and the code in the engine is very clean and understandable to any MooTools user. We’d loose some of this if we moved to Sizzle.

This is the point that I’m most confused about. I will put money down, right now, that Sizzle is more extensible than any other CSS selector engine in any of the major libraries – MooTools included. jQuery selectors have been, traditionally, very extensible but I went far beyond that with Sizzle’s implementation and you can extend any selector in virtually any direction. If there are any specific extension concerns I’d love to address them but as far as I know there really aren’t any.

I stand corrected. I’ve since spent a little more time on the topic and John is totally correct that Sizzle is very extensible. My bad there.

I don’t know about “more extensible than any other CSS selector engine” – seems to me that either the engine is extensible or it isn’t. I haven’t seen any complaints about MooTools extensibility in this regard, so we haven’t encountered a use case that our engine doesn’t handle. But regardless, I was incorrect in that statement in my previous post. My bad.

There’s something to be said about autonomy. By having its own selector engine, MooTools can add functionality and manage its own needs.

You can absolutely add your own functionality to Sizzle – in fact a number of libraries are already doing it. For example jQuery has :hidden and :visible – but keeps them within its engine – they are not a part of Sizzle. Both Prototype and MochiKit are looking to do this, as well. That’s the beauty of the extensibility here. Such an extensible architecture means that you’ll be able to add your snap-in your own functionality.

There’s a difference between being able to extend a technology and writing it yourself. There are reasons that there are so many JavaScript frameworks. There are a lot of ways to do this stuff and none of them are wrong or right. It’s a matter of personal taste. My point above is just to say that autonomy has some benefits. Again, I want to reiterate that I’m not advocating publicly whether I think MooTools should or should not adopt Sizzle. Just trying to kick off the discussion in our community.

While adding Sizzle might be a nice gesture to the community, illustrating that we can all get along together, it may not offer any other big benefits (if you don’t consider any of the Pros above big benefits).

I’m not sure what is being referred to here. It’s important to note that it’s not just illustrating that we can get along together – it’s actually getting along together. A lot can be said for standardization. If there wasn’t some form of standardization between browser vendords, for example, we’d be in a much rougher place right now.

My point here is that coming together has some nice benefits, but from a use case perspective, it’s not that big of a deal. If $$(‘div.foo’) works, our developers aren’t going to really care one way or the other. Personally, I see the benefits of using Sizzle as the selector engine for MooTools as being a net zero – it’s got benefits and negatives. In my mind, they kind of cancel each other out. That’s why I’m so keen to see what our users think of it. I could go either way.

One could argue that healthy competition is the reason we have fast CSS engines like Sizzle in the first place. If we all consolidate then maybe that innovation slacks off. One could counter that by saying that selector engines are so fast now that it’s really quite negligible and that any likely speed increase won’t come through further iteration on the JavaScript.

Two points:

  1. You’re assuming that the only driving force of performance improvements is a specific outside force (such as another implementation). But you’re forgetting the biggest outside force of all: The users.

I’m not assuming anything nor am I forgetting anyone, thank you. But I think that competition is healthy and all of the frameworks have benefited from seeing how we all solve the same problems. MooTools has certainly benefited from Dean Edward’s work, Prototype’s work, and jQuery’s work. As Stravinsky said, ‘good composers borrow; great composers steal.’

Continuing with John’s point:

In the jQuery project we’ve been making constant performance improvements to a variety of methods and components – because it’ll make the code faster for the users – NOT because there’s some 3rd party test suite that demands we have faster numbers. With so many minds at the table (all the major libraries) it’ll mean that this library will be in front of the majority of JavaScript users, in one way or another. It will be compelled to become faster.

Again, speed, at this point, I think is moot. At least for MooTools developers. jQuery has a pattern that uses selectors a lot, which is totally cool and accessible to a lot of people writing and learning JavaScript. MooTools encourages developers to select once and manage state. I’m not arguing that one way is better or worse, but as far as I’m concerned, I’m quite satisfied with the efficiency in the MooTools selector engine.

We released SlickSpeed to be able to learn from other frameworks. If we could see that someone else was able to perform a selector much faster than we could, then we knew we had work to do. At this point the numbers are so low for most selectors and real world use cases that speed isn’t the concern anymore. Any gains we hope to make at this point are going to come from the browsers.

  • While the competition has been good, it also has its ugly side. For example, not a single major JavaScript library implements document-order multiple selectors (e.g. returning “h1, h2, h3? in the order in which they’re in the document – not all h1s followed by all h2s, etc.). No library does this because they would get instantly decimated on SlickSpeed. It’s going to be really important, going forward, that we start to match the published specifications (Selectors API) more closely, otherwise we are going to confuse users and break sites. Competition certainly hasn’t helped libraries to progress in this nature.
  • I’ll still take that healthy competition any day, and I don’t know that there has really been an ugly side. Returning results in the manner that John describes is, to me, a need the browsers need to support as doing it in JavaScript just isn’t practical. Further, I’ve written a LOT of JavaScript (though I’m not claiming that it’s more than others for sure) and only rarely – if ever – do I find myself wishing I had this kind of selector capability.

    My final thoughts are that MooTools could benefit from Sizzle and being a consumer of and contributor to this common layer for all the frameworks. But there aren’t that many compelling reasons to do this right now. If it were my choice (and it most certainly isn’t) I’d be inclined to take a wait-and-see approach. If Dojo adopts the project (did that vote already pass? I’m assuming it will) then I’d want to see what Sizzle looks like on the next release. I know John will continue to be a big contributor but by handing it over to Dojo – an awesome move I think – he’s basically saying that everyone should own it. I want to see what it looks like when everyone does. Maybe then the benefits will be much more clear to me.

    Sizzle Power in MooTools?

    December 3rd, 2008 by Aaron N.

    There’s a lovely post on Ajaxian today that the Dojo community is now voting on whether or not to swap out their own selector engine for Sizzle, Jon Resig’s CSS selector engine. Several other frameworks are considering doing the same thing. jQuery is using it already of course, but Prototype, MochiKit and others are all looking into it.

    One the one hand, it kind of makes sense for frameworks to work together for these types of things. Why invent the same wheel over and over again? What about event management? Garbage collection? Why not consolidate a lot of this stuff?

    As I’ve written previously, I think that frameworks are really only different from each other at the core and at the edges. That is, the way they do things at their most fundamental and abstract levels (like inheritance management and whether or not the extend JavaScript’s native objects – that sort of thing) and also the interface – the actual syntax they provide. But CSS selectors? Who cares about that? So long as the selectors use the CSS3 standards (perhaps with a few extra ones thrown in for good measure) the interface is the same, right? I mean, jQuery(‘div.foo’) vs $$(‘div.foo’) – the interface – what those methods ($$ and jQuery) return is what matters – who cares what the engine is that finds all the divs, right?

    This is middle-ware. Sure, a year or two ago, the selector engines in frameworks were very different and some where far faster than their counterparts. But the MooTools team released Slickspeed and set off an arms race for selector engines. This competition was really good for everyone and is the reason that almost all the frameworks are so fast now. Why keep hacking at this problem if it’s basically solved. The only way that selectors are going to get fasters is if the browser developers continue to optimize the JavaScript engines.

    So, as I see it, here are the pros and cons of swapping out the MooTools’ selector engine for Sizzle.

    Pros

    • MooTools benefits from development contributed by all the other framework authors. Someone on the Dojo team figures out how to do something faster, and whammo, MooTools gets it, too. The obverse is true as well – MooTools can contribute to the speed and stability of other frameworks in the same way.
    • It means fewer bugs that the MooTools developers have to squash. When new browsers show up that introduce new capabilities, core the developers don’t have to drop everything to rework things.
    • It sets a precedent for the notion that the framework teams out there (including the MooTools team) don’t have to write everything themselves. Let’s focus on what makes our frameworks different and delegate the things that make them similar.
    • It makes it easier to move from one framework to another. Custom selectors and the like are available to all frameworks.
    • More clout can be had with the browser vendors if all the frameworks are using the same standard.
    • It would show that the frameworks can actually agree on something for a change and that this isn’t a competition.

    Cons

    • CSS selectors are, by and large, all about as fast as the next now. There’s not much benefit to be had as far as speed is concerned.
    • Sizzle caches selector results, which we could add to MooTools if we liked and we might, but perhaps this isn’t something everyone wants.
    • The MooTools coding philosophy is definitely set on having extensible code. Anyone can author custom selectors for the MooTools selector engine and the code in the engine is very clean and understandable to any MooTools user. We’d loose some of this if we moved to Sizzle. I have since been corrected here: Sizzle is very extensible.
    • There’s something to be said about autonomy. By having its own selector engine, MooTools can add functionality and manage its own needs.
    • While adding Sizzle might be a nice gesture to the community, illustrating that we can all get along together, it may not offer any other big benefits (if you don’t consider any of the Pros above big benefits).
    • One could argue that healthy competition is the reason we have fast CSS engines like Sizzle in the first place. If we all consolidate then maybe that innovation slacks off. One could counter that by saying that selector engines are so fast now that it’s really quite negligible and that any likely speed increase won’t come through further iteration on the JavaScript.

    Are there other pros and cons I haven’t thought of? I feel like I’m missing something, I dunno.

    What are your thoughts as a MooTools user (if you are one)? Does this even matter to you? Do you have a preference? Would it make you happy to see MooTools adopt this standard bit of code or would you rather see MooTools maintain its own query engine?

    Do tell.

    I’ve posted a followup to this post that responds to some of the comments left here and elsewhere on the net.

    The Reddit crowd weighs in on the JavaScript WTF

    November 22nd, 2008 by Aaron N.

    So my traffic went kaboom yesterday (most traffic I’ve ever gotten – period) because my post made the home page of reddit apparently. This is novel and I welcome all those viewers to my little corner of the tubes. What’s interesting though is the conversation going on over there.

    I’ll point out that the code in question (on a Function.apply method for IE5) that I understand why Microsoft would write such a hack, as IE5 doesn’t have a suitable method for deferment and they can’t just ignore those users. It’s easy for me and others to be entertained by such a hack, but it’s not like I suggested an alternative.

    To be frank, I simply wouldn’t even try to. IE5 is 9 and a half years old and I don’t envy anyone who has to support it. I was amused by the method I posted, but hey, it works, and that’s about all that really matters.

    Still, that said, it is possible to implement a more elegant apply method for IE5. Here’s an example from google’s code base:

    if (!Function.prototype.apply) {
      Function.prototype.apply = function(oScope, args) {
        var sarg = [];
        var rtrn, call;
    
        if (!oScope) oScope = goog.global;
        if (!args) args = [];
    
        for (var i = 0; i < args.length; i++) {
          sarg[i] = 'args[' + i + ']';
        }
    
        call = 'oScope.__applyTemp__.peek().(' + sarg.join(',') + ');';
    
        if (!oScope['__applyTemp__']) {
          oScope['__applyTemp__'] = [];
        }
    
        oScope['__applyTemp__'].push(this);
        rtrn = eval(call);
        oScope['__applyTemp__'].pop();
    
        return rtrn;
      };
    }

    Now, one could argue that this is an ugly hack too. Using eval and whatnot. But there are two things about it that make it a better solution in my book (and to be clear, there are no doubt even better ones out there – I haven’t searched that hard). Those two things are:

    1. The function isn’t limited by the number of arguments you can pass it. In the MSFT version, if you passed in more than 10 arguments, you just got a ridiculous error.
    2. More importantly, it defines apply only if it doesn’t already exist. The MSFT code defines its method for everyone and it’s not even on the Function prototype. Rather than testing to see if the method they needed exists, they opt to just use a non-native hack that uses eval.

    It’s easy to call this one from the sidelines as being a ridiculous hack, but I genuinely sympathize with someone who has to support JavaScript on IE5. That said, acting like every browser is IE5 is just inflicting pain one’s self for no good reason.

    How Many Flavors of Linux Are There?

    October 8th, 2008 by Aaron N.

    It’s hard to write about what you like about an open source project that that solves (or at least attempts to solve) a problem that other open source projects are also trying to solve (using different methods). It looks like you’re competing with each other, but really all that’s going on is that two groups of people share a problem and are the kind of people who enjoy solving that kind of problem and have their own specific ideas about how to do it. How many flavors of Linux are there?
    Read the rest of this entry »

    jQuery, MooTools, the Ajax Experience, Programming to the Pattern, and What Really Makes One Framework Different From Another

    October 3rd, 2008 by Aaron N.

    I just got back from the Ajax Experience in Boston and I’ve had a lot of stuff on my mind.

    jQuery Has A Posse

    First, I must first attest that hands down, jQuery was the most popular and well represented framework there. They ruled the roost. John Resig (creator of jQuery) spoke 7 times in 3 days, Microsoft demonstrated how jQuery is included in its SDK, and the crowd attending was definitely there to talk about the framework. More than anything, this made it clear to me that jQuery is doing something right.

    Part of the task I set for myself in attending the conference was to attend as many of these jQuery sessions as I could both to learn as much of jQuery as I could (I have, in the past, dug into it, but I wanted to soak up as much as I could from the development team and John) and also to see if I could pick up on what accounts for the popularity of the framework.
    Read the rest of this entry »

    Localizations for the Clientside code

    September 24th, 2008 by Aaron N.

    Thanks to the help of several users of our code base we now have translations for our FormValidator class for Chinese, Italian, French, Portuguese, Spanish, Dutch, and Catalan (!!). This is awesome stuff. While I personally haven’t worked on any projects that have been localized, it’s nice to see our code base gain greater flexibility and usability thanks to our users.

    Today someone asked me to make it possible to localize the Date method timeAgoInWords, which returns things like “about a minute ago” (you can find this in Date.Extras). So we’ve added support for this too (though we don’t have any localizations for it). If you decide that you want to translate either of these things, drop us a line.

    Bandwidth and CPU issues here at Clientside

    September 11th, 2008 by Aaron N.

    Just a quick note. Over the last two days this site has been down off and on due to CPU/Bandwidth over-usage. We host this blog on a 3rd party server because, for the most part, it’s just easier. CNET has it’s own blog platform that’s built to handle a ton of traffic, but wasn’t the easiest place to be able to hack together quick code examples and demos. Given that all we needed was a wordpress install and some customized wiki software (for the tutorials), it just didn’t make sense to try and make it work on our enterprise servers.

    We discovered today what we think the culprit was – some deep links to some of our images that were sapping our resources – and have that sorted out. Hopefully we won’t encounter any more outages. Thanks for your patience.

    Thoughts on coding and new classes as a result…

    September 4th, 2008 by Aaron N.

    A short while back I was helping out a coworker who was working on a content management system with a very rich UI. In helping him work out some of the issues he was struggling with, I had one of those rare moments where I conceived of a better way to write my own code.

    Some of his struggles were performance related – he had a LOT going on, but those were really an extension of the fact that his code was kind of all over the place. What started as an interface with some nice enhancements had grown into a behemoth of functions, namespaces, dom references and conventions that he couldn’t hope to keep straight anymore.

    Part of what I suggested to him was that he start treating items on the page as widgets. Every portion of the interface could be broken up into little bits of functionality with a corresponding (MooTools) class and then larger items would be comprised of these smaller things. The larger items would have their own classes as well. These would act like controllers for the smaller ones.

    Over the next few weeks he refactored his code and when I saw him it was aparent that he was much happier. Relieved even. The result is a structured family of functionalities that each correspond to little chunks of his UI. He can combine these in various ways for different use cases and work flows. He can extend the classes when he needs something that’s slightly different.

    His sense of relief was so apparent that I began rethinking my own approach to my code. Read the rest of this entry »

    Class::Binds Mutator

    July 1st, 2008 by Aaron N.

    Jan Kassens, a MooTools contributor, has posted a nifty little trick to help you automatically bind methods to a class. Usually when we reference a method of a class when adding an event, we bind “this” to it to keep our reference to the class (this.addEvent(‘onComplete’, this.complete.bind(this))). This is great until we want to remove that event with removeEvent, which requires we reference the function again. the .bind method creates a copy of the function, so we have to store a reference to it. It’s all very messy. Introducing the Binds mutator. Look for it in the next MooTools patch release, but you can start using it now if you just include the 10 lines Jan has posted.

    I wasn’t quite happy with this solution, because it’s too verbose: why always use this.bound.myFn when I always want the bound one? Secondly, I don’t want to do the binding of all these functions by hand. After some discussions on different solutions this is what I come up with as the optimum between speed (don’t worry its faster than the solution above) and usability.

    A new so called “class mutator” named Binds. Most of you probably didn’t hear of class mutators before, but you sure have used a class mutator before when you’ve written one or another class. Built in mutators are Implements and Extends...