Unobtrusive Java Script - Best Practices

Best Practices

Though the essence of unobtrusive JavaScript is the concept of an added separate behavior layer, advocates of the paradigm generally subscribe to a number of related principles, such as:

  • DOM Scripting, i.e. adherence to the W3C DOM and event model, and avoidance of browser-specific extensions.
  • Capability detection, i.e. testing for specific functionality before it is used. In particular this is seen as the opposite of browser detection.
  • More generally, JavaScript best practices often parallel those in other programming languages, such as encapsulation and abstraction layers, avoidance of global variables, meaningful naming conventions, use of appropriate design patterns, and systematic testing. Such principles are essential to large-scale software development, but have not been widely observed in JavaScript programming in the past; their adoption is seen as an essential component of JavaScript's transition from a "toy" language to a tool for serious development.

Read more about this topic:  Unobtrusive Java Script

Famous quotes containing the word practices:

    They that have grown old in a single state are generally found to be morose, fretful and captious; tenacious of their own practices and maxims; soon offended by contradiction or negligence; and impatient of any association but with those that will watch their nod, and submit themselves to unlimited authority.
    Samuel Johnson (1709–1784)

    Money made through dishonest practices will not last long.
    Chinese proverb.