Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Writing Bug-Free Scripts and... > Prevention Is Better Than Cure

10.1. Prevention Is Better Than Cure

It is far better to avoid introducing bugs than to remove them. There's no way to guarantee bug-free scripts, but a number of precautions can reduce the frequency considerably. Making your code easy to read helps. So does documenting it, so that you know what it's for, what it expects, what results it produces, and so on.

10.1.1. Structure Your Programs

The term structured programming is applied to various programming paradigms, but they all involve modular programming—breaking the problem down into manageable parts. In developing a large application with the shell, this means either functions, separate scripts, or a combination of both.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint