Pages

Showing posts with label Best Practice. Show all posts
Showing posts with label Best Practice. Show all posts

Saturday, November 29, 2014

Scrum + Planning Poker + Code Clone Detection in Visual Studio 2012 – Presentation

Today I got a chance to present on three topics during the “System Analysis and Design” course mode of my MSc in IT course. It was very interactive during the presentations. So I would like to share the presentations on the topics.. I would like to thank my lecturer Mr. Chaman Wijesiriwardane for giving me the opportunity.

Scrum Software Development Methodology

 

Planning Poker estimating technique

Code Clone Detection in Visual Studio 2012

Saturday, April 19, 2014

How to prevent from declaring global variables in JavaScript?

Introduction

When we declare a variable in JavaScript; if its declared with the var keyword it will be a local variable and if we omit the var key work it will be implicitly declared as the global variable. Developers are always careful on creating global variables.

Problem Background

Developers may accidentally declare global variable without their knowledge.

Solution

  1.  
  2. function funcationName() {
  3.      "use strict";
  4. };


To avoid developers from creating global variable you can use strict mode as given below. .

 
Conclusion

If we use strict method; when we debug we will get an exception on the line where we have declared global variables. See the screenshot below.