Link Details

Link 1180879 thumbnail
User 225256 avatar

By mswatcher
via ardalis.com
Submitted: Jul 15 2014 / 09:03

A key best practice if you’re writing JavaScript code is to avoid adding objects to the global scope.  There are several good reasons for this – globals add coupling, it makes it easier for disparate libraries to break one another, etc.  A general rule of programming is to avoid global scope, in fact.  Unfortunately, JavaScript makes adding things to global scope very easy.
  • 2
  • 1
  • 99
  • 17

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (1)



Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java