Key Points

  • Production code should handle errors in a more sophisticated way than "garbage in, garbage out."

  • Defensive-programming techniques make errors easier to find, easier to fix, and less damaging to production code.

  • Assertions can help detect errors early, especially in large systems, high-reliability systems, and fast-changing code bases.

  • The decision about how to handle bad inputs is a key error-handling decision and a key high-level design decision.

  • Exceptions provide a means of handling errors that operates in a different dimension from the normal flow of the code. They are a valuable addition to the programmer's intellectual toolbox when used with care, and they should be weighed against other error-processing techniques.

  • Constraints that apply to the production system do not necessarily apply to the development version. You can use that to your advantage, adding code to the development version that helps to flush out errors quickly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.85