Namespacing has become an important issue as the number of addons grows. Putting it in very simple terms, as the number of addons grows the chances of “two different addons using the same global variable/function” increases. This can lead to conflicts. Additionally many of the simpler addons inherit (or reuse) publicly available code possible from Mozilla developer sites. Thus the chances only multiply. A more detailed coverage can be found in the article Respecting the JavaScript global namespace.
ColorfulTabs is a very old addon and has evolved with the times. Thus I recoded everything from the ground up when developers got aware about the namespacing issue. However as it was, during the course of development and due to the relatively complex code, new variables were introduced. It was thus important to clean up the code and additionally verify compliance with coding best practices.
An excellent tool for finding variables and functions in the global namespace is the Reviewers’ Extensions which is easy to use and lists all the variables in the global namespace. You can use it to track how other addons in your profile too and find out which are the ones introducing the most noise.
Join 37,807 others and get free tutorials & tips on design & development using Wordpress on, Thesis & Genesis!
