Re:How Good C# Habits can Encourage Bad JavaScript Habits
by erik14th on Friday May 10, 2013 @02:09AM
(#5684866)
In the browser, you have the global scope in the window object o it's pretty easy to define a construct for namespaces.
I thought about the namespaces thing and it sounds like a better idea than encapsulating stuff into anonymous functions so I made a little boilerplate that implement basic OOP features:
I thought about the namespaces thing and it sounds like a better idea than encapsulating stuff into anonymous functions so I made a little boilerplate that implement basic OOP features:
http://jsfiddle.net/L4Tcw/21/
Only thing that I think smells a bit is having to keep a reference to 'this' of the main object.