Rant of the Day: Namespaces

This is just a really quick post to try and vent my frustrations! Why don’t web developers use namespacing?

It is so frustrating when you’re tying to integrate a 3rd party plugin into your website! For example, I have a page containing some pre-existing JavaScript, and I want to add a nice little piece of JavaScript functionality into the page, however, when I do it conflicts with the existing JavaScript because it doesn’t use any namespacing! Or even worse it uses the magic “$” function without a care in the world what else might be using it.


And it’s not limited to JavaScript – there are some CSS frameworks out there that don’t employ this easy-to-use-yet-frustration-saving-technique or plugins developed for popular blogging software that use CSS that isn’t namespaced either – so it screws up your lovely styles.

Double Argh!

This is not a new concept, it’s not difficult to do, and it saves much pain and suffering of a developer who is up against a deadline! All it takes is just a little thought to how people are going to use your plugins, and how your plugin will get along with everything else.

So dear developers out there, all I ask of you is this: please, please, please namespace.

Caveat: This is just me having a rant. I know how much work and effort goes into creating 3rd party plugins etc for the benefit of all, often with little or no reward. I thoroughly appreciate this work done for the love of it by selfless individuals. All I’m saying is if you take that much care and time over something, wouldn’t you want to make sure it doesn’t break somebody else’s work, which has has an equal amount of care and time spent on it?