/
Reconsider JavaScript ways
Reconsider JavaScript ways
Right now the most JavaScript heavy part of In-Portal is an Admin Console. It works, but it can be better structured internally.
Currently we have 2 major problems in JavaScript:
- polluting global scope (every JS file, that is included is adding some new functions/classes to globals scope and other JS hoping that these functions/classes will just be there when they need them)
- including all javascript files regardless of their actual usage (http://requirejs.org/ can help here)
- not using jslint to adhere JavaScript creator (Douglas Crockford) recommendations
- not using strict mode (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode), which allows to uncover potential problems in code early