[JSMentors] Re: Namespacing/Module Pattern: Why avoid overwriting an existing object?

2011-06-24 Thread Philip Schweiger
Thanks for the response. On Jun 21, 10:41 am, "David Marrs" wrote: > You're not overwriting the namespace, but extending it, so you wouldn't want > to fail if an object is already there. It just means that you can separate > your code out into separate files in a reliable way. > > You can also

Re: [JSMentors] Re: Namespacing/Module Pattern: Why avoid overwriting an existing object?

2011-06-21 Thread Nick Morgan
On 21 June 2011 13:46, Philip Schweiger wrote: > Ok, that makes a bit more sense. I can see that working when you have > complex code with different dependencies loading at different times. I > think it makes a bit less sense when dealing with smaller, self- > contained modules as opposed to names

[JSMentors] Re: Namespacing/Module Pattern: Why avoid overwriting an existing object?

2011-06-21 Thread Philip Schweiger
Ok, that makes a bit more sense. I can see that working when you have complex code with different dependencies loading at different times. I think it makes a bit less sense when dealing with smaller, self- contained modules as opposed to namespaces, though - in that case, I still think it would mak