"Hey Scott, Reviewing your notes, I maintain that these tests aren't flawed. We're purposefully benchmarking the combined memoization and lookup times as a part of this experiment. You have highlighted however a very interesting (and important) point - from the perspective of the latter, it's just as critical that one analyze the lookup times independently to gauge just how well this part of the process performs. Your jsPerf test indicates the Fuchs implementation to be the fastest here and we have no problem admitting that when it comes to the look-up phase, it is. I guess it boils down to where someone is hitting pain-points in their application, the actual memoization phase or (arguably, depending on what you're doing - the more important lookup phase). I'd advise others to checkout your test just to be aware of all the gotchas. Cheers! Addy"
- Addy Osmani
"You'll be happy to know that our design team at jQuery have been working hard on a new layout for all the jQuery projects (core, UI, mobile etc) and (in my opinion) the design that's going to get rolled out sets the bar quite high. We're hoping to release it in the next few months so watch that space!. You're absolutely right..there are OSS projects that just don't grok the importance of a well designed site, but there are solutions to that: if someone was to create a better looking website for them in a fork and showed it to the community, they could then let the project maintainers know whether or not thats the direction they'd like the site to take. Progress in these areas is definitely possible, even if it can take time."
- Addy Osmani
"Thanks! I believe I corrected it earlier, but I've just flushed the site cache in case it hasn't showed up yet. With respect to that article, I've indeed read it before but couldn't for the life of me locate the link back to it again. Thanks for sharing!. I'll update the post with some references to it when I get a chance."
- Addy Osmani
"You'd be surprised just how useful even reporting bugs can be :) . I like to think of the open-source community as some sort of giant, wonderful hive where we're all able to do our part, regardless of how small, in contributing back. Without bug reports, library authors/contributors wouldn't be able to ensure erroneous behaviour is patched for everyone else, so keep doing that!. In time, when you're ready, you can always do more!"
- Addy Osmani
"Hi Kyle, I would recommend checking out the RequireJS optimizer (if you haven't already), which allows you to combine your various script modules into one (or more) files and then minify them using UglifyJS - it's actually part of r.js, so unsure if you've explored it. Using this, your users don't have to rely on a script loader and a lot of the process doesn't require significant manual effort to get setup. Check out the optimizer here: http://requirejs.org/docs.... Are you looking to generalize the module namespaces into a more global one using the process you mentioned or are you just looking for a solution like the above? Cheers! Addy"
- Addy Osmani
"@webXL @aaronlpeterson Thanks for pointing that out. I think it was just an oversight on our part as we only wrote this up this morning : - ). I've updated the post to use the (better) .extend() pattern you've mentioned. I think the sentence about avoiding some of the uses of the OR operator mentioned is critical for any post like this. There are hundreds of interesting "quirks" with the language that are useful to know, even if useful means knowing when *not* to use them :)"
- Addy Osmani
"Hey Stuart. It looks like SoundCloud is being (very) slow today. I've updated the post with a direct link to the play page in case anyone else has the same issue."
- Addy Osmani
"Sure. If you're finding that stackexchange and stackoverflow aren't providing the level of feedback you're after, I would consider trying to ask other JavaScript developers in the community (those who you feel might be experienced/qualified enough to answer) to try their hand at a review. Look at developers who actively contribute to open-source projects for example. Now, a lot of them might be busy with other projects, but post some code in a gist, ask them on twitter for their opinion on whether anything could be done better and see if you get a response (you may find developers who contribute to smaller projects more able to assist here). The important thing is to make sure not to spam anyone. I can't personally speak for others but it regularly takes me a few days to get back to all the messages I get, but I try my best and I'm sure its the same with others. Hope that helps!"
- Addy Osmani
"I read your post, but I'm a little confused about your findings. You suggest that using the single-variable pattern can cause you to run into issues with scope because JavaScript will effectively force any variables after the first line in that pattern to be global. Here's a jsFiddle where attempting to access variables defined after the first comma cannot be accessed within the global scope, only within the local function scope, which is how I expect it to work. http://jsfiddle.net/zVC4Z/2/ Is there something I'm missing?"
- Addy Osmani
"I think performance benchmarking really plays a big role here. Ideally, most calculations should be done on the client-side/in the browser without the need to push data back to the server in order to compute a result. That said, if you find that computing results (based on the complexity of the work involved) is so great that it's taking longer than acceptable when done in the browser, that's the point where I would shift those calculations server-side. It's something to be considered on a case-by-case basis."
- Addy Osmani
"Hey Elf. You make a valid point, but I should note that whilst I advocate the usage of more modular architectures to building applications, I do still see developers using deep namespaces on a regular basis, possibly because they've been 'inspired' by the approach taken by YUI. In the face of this, anything we can do to encourage smarter techniques of addressing deep/nested namespacing can still help a few developers. I'll probably note in the larger-scale architecture posts that this level of namespacing isn't terribly useful, but again, I don't necessarily want to force anyone to avoid what they feel is the most comfortable option for their application when it comes to this area (at least, not yet) ; )"
- Addy Osmani
"lol. I thought I had mentioned this in reply to another comment, but I actually went on to write a rather long post about Deferreds with Julian Aubourg (one of the developers involved in implementing them in jQuery). You can find our post on them here: http://msdn.microsoft.com/en-us......"
- Addy Osmani
"Sure thing! As long as the credits/links back to the original post are there, that would be great. Please feel free to comment back with your translation as I can then link to it in the post for other readers that might be interested in it."
- Addy Osmani
"Hey James, (Thank *you* for pushing to get that change into jQuery!). I appreciate the clarification on the current position of AMD with respect to CommonJS. I had assumed that it was still being referenced as a CommonJS project, but I'll be sure to update the post to reflect the correct naming asap. Thanks for stopping by. Addy"
- Addy Osmani
"A very quick update: For anyone wishing to use the memoizer at a production level, we now have a whole set of new improvements and optimizations which have been added to it. We also now have tests included and documentation (outside of this post) is on the way. To follow our progress, checkout the project repo: https://github.com/addyosm..."
- Addy Osmani
"Thanks Dmitry. We applied this optimization to the memoizer during the last round of changes in the repo. I'll update the post to reflect this."
- Addy Osmani
"Hey guys. I'm currently getting ready for a few conferences so haven't had a chance to reply to everyone on this thread, but if you're looking for more detailed articles about specific design patterns, please feel free to look through the rest of the site. Someone was asking about more detail on the Observer pattern. I actually have quite a nice, detailed post on this available both here and on Script Junkie. For more information on modules, you may find my Large-scale JS article useful. The second volume of the Design Patterns book is currently being worked on and will contained detailed examples for most patterns."
- Addy Osmani
"Likewise, John! :) I'm planning on getting an initial 'plugin/module'-like patterns post out some time next week, which will hopefully help kick off some further discussions about that area. With respect to CommonJS, absolutely. It does solve a lot of the issues we've been facing with collisions and I very-much want to get a write-up done at some point that explains the hows and whys in a little more detail. Interesting times ahead for sure! :)"
- Addy Osmani
"To the best of my knowledge, a semi-colon used before function invocation is a safety net against concatenated scripts which may not be closed properly. It's admittedly not something you need to worry about when working with smaller projects where you're in complete control of all the scripts being inserted, however it's more there to account for third-party scripts that might be inadequately closed than anything else."
- Addy Osmani
"Whilst using a script loader or module manager works great for solving some of the global leakage/clobbering issues, you need to remember that not everyone uses them (just yet) ; )"
- Addy Osmani