How to organize code in “namespaces”
When you use lots of libraries in your code, you can easily pick up a function name that corresponds to a pre-existing name in some library that you might have included. To avoid that, you should create namespaces that encapsulate the code of your application:
[source:javascript] var net = { kosmaczewski: { adrian: { blog: { articles: {}, images: {}, snippents: {}, tutorials: {}, rants: {} } } } };
// Shortcut (for performance purposes) var blog = net.kosmaczewski.adrian.blog; [/source] Continue reading