glebec / debugging-js

Debugging JavaScript — a Practical Distillation for Students

Home Page:http://bit.ly/debugging-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugging JavaScript Applications

A Practical Distillation for Students

Faults in computer problems were theorized as far back as 1843, when Ada Lovelace noted of Babbage's Analytical Engine, "Granted that the actual mechanism is unerring in its processes, the cards may give it wrong orders." Almost 160 years later, NIST reported that software errors cost the US $59 billion annually. Clearly, some of the cards are wrong. However, unlike Grace Hopper's famous moth, most of the time the culprit is ourselves.

Debugging is a sanitization procedure consisting of:

  • Preventing bugs in the first place, through good practices and assistive tooling.
  • Detecting bugs when they first arise, through proper error handling and testing.
  • Diagnosing and locating bugs, through the scientific method and interactive tooling.
  • Treating bugs, through reasoned analysis and patient refactoring.
  • Reinforcing code health, through additional testing and reflection.

The heroic console.log may be your first line of defense, but it need not be your last. Anyone can improve their debugging skills, with great payoff. Studies show a 20:1 difference in time to debug between experienced and inexperienced developers, also leaving (and creating!) far fewer bugs in the process (McConnell, Code Complete).


This GitBook began as a Gist for Fullstack Academy students. The source is hosted on GitHub where you can open issues or contribute edits via pull requests. The book can be easily read, browsed, and commented on here.