You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some ways to create namespaces than span several files in javascript (such as described here and argued against in here). It would be nice if coffescript featured a namespace or module (from those coming from ruby) way to make namespaces span several files (closures can't really do it).
The compiled code can join them all in one closure, but for writing it would be much nicer. Also kinda like python's "from x import a, b, c".
The text was updated successfully, but these errors were encountered:
Modules in JavaScript are usually just JS objects -- which is all well and good, in my opinion. I don't think we need special language support for this... especially because we have destructuring assignment, which can be used to import a number of properties from a module in a single blow.
Very nice questions and answers. However, doing it all the time can be quite a big performance hit. If a module is divided in 30 files, and all of them import 10 classes, you will have 300 assingnments instead of 0. This gets even bigger for several modules. And it has a terrible sideback of poluting the default this scope when importing everything at top level (which is the only way to do this without eval'ing the destructuring assignment inside a function scope).
There are some ways to create namespaces than span several files in javascript (such as described here and argued against in here). It would be nice if coffescript featured a namespace or module (from those coming from ruby) way to make namespaces span several files (closures can't really do it).
The compiled code can join them all in one closure, but for writing it would be much nicer. Also kinda like python's "from x import a, b, c".
The text was updated successfully, but these errors were encountered: