Nov 24th, another Techday7 event. This time Ramkumar and karthi are presenters and they presented about Javascript best practices and Titanium alloy framework.
here is slide show about Javascript best practices by Ramkumar M
[slideshare id=15327214&doc=javascript-121124090451-phpapp02&w=670&h=530]
Few quick points:-
* About GC in Javascript, GC is automatic.Objects are collected there is no references longer. Javascript Uses Mark and Sweep GC method.
* Avoid the global scope. In the Global scope the Object never null, so never garbage collected. It’s time taking and trivial process to get the reference of global scope. If need to use global scope assign yourself null after the use.
* Use var. Don’t forget to use var for all your variables. The Variables without var may considered to global. You are making javascript to struggle for finding the scope of your variable
* Get Use of Self-Calling Functions. Have any one noticied jQuery using self calling functions
* Don’t D.R.Y. Make the reusability. Make use of Namespace