Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to have shorter variable names #6

Open
jakub-g opened this issue Mar 5, 2015 · 0 comments
Open

Option to have shorter variable names #6

jakub-g opened this issue Mar 5, 2015 · 0 comments

Comments

@jakub-g
Copy link
Collaborator

jakub-g commented Mar 5, 2015

Right now exported variables have pretty long names, like this:

 var modulesCoreUtilsDataManager = require("modules/core/utils/DataManager");

This was a good design decision to minimize the risk of variable names clashes.

It would be interesting though to have an option to support shorter variable names, like this:

var DataManager = require("modules/core/utils/DataManager");

though this would require quite a bit of work to minimize the risk of collisions, in cases like this:

var modulesUtilsFooBar = require("modules/utils/foo/Bar");
var modulesSthelseBar = require("modules/sthelse/Bar");

This is unlikely but may happen and with a naive approach both requires would have been saved into the same variable.

Also, the variable created by require could perhaps be redeclared later in the code as a local variable in the methods of a tplscript/controller and this could also break things.

jakub-g added a commit to jakub-g/at-noder-converter that referenced this issue Mar 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant