concept single responsibility principle in category javascript

appears as: single responsibility principle
JavaScript Application Design: A Build First Approach

This is an excerpt from Manning's book JavaScript Application Design: A Build First Approach.

How do you plan for failure, though? Well, that’s the sad part; nothing you do will prevent failure. Everyone has downtime, even giants such as Microsoft, Google, Facebook, and Twitter. You can plan all you want, but your application is going to fail regardless of what you do. What you can do is develop a modular architecture that’s capable of dealing with services going boom and instances going bust. If you can achieve that modularity, it shouldn’t be as damaging when a single module stops working, because the rest would still be perfectly functional. We’ll develop notions of modularity, and the single responsibility principle (SRP) in chapter 5, dedicated to modular design and a crash-course introduction to the Node.js platform.

Up to this point, you’ve looked at the single responsibility principle, information hiding, and how to apply those in JavaScript. You also have a decent idea of how variables are scoped and hoisted. Let’s move on to closures. These will help you create new scopes and prevent variables from leaking information.