3 ms·
I like it for how single-minded it is. Do one thing and do it well. Here's my one question (and it's not specific to namespace.js) How to do imports so I can
by calebmpeterson 16y ago
I like it for how single-minded it is. Do one thing and do it well.
Here's my one question (and it's not specific to namespace.js)
How to do imports so I can avoid
var obj = new namespace.com.foo.bar.baz.FooBar(...);
- mckoss 16y agoI will generally have an "imports" type line at the top of my module, and then use the abbreviated name in the code. This is similar to Python's "from module import name" pattern. var library = namespace.com.foo.bar.baz; ... var obj = new library.FooBar(); It's generally considered a best practice (in the Python community) to leave the external module name (like "library", above) so that someone reading your code can recognize which functions are external to your module, and which ones are local.
- calebmpeterson 16y agoThanks for the input!