5.3 Scripts to functions to classes
Back in Chapter 1, we showed a long script. This script consumed a number of files in JSON notation, and summarized some details. The script works. From one perspective, if it works, what more is needed?
The answer is two-fold:
-
We need reason to believe the script works
-
We need to be able to adapt and maintain the script
How do we know software works? The “try it and see” approach can be expensive and frustrating.
When dealing with something safe and relatively inexpensive, such as a new bookmark, we can put it between pages in a book and confirm that it works. We do have to inspect it, though. Using a slice of freshly-cooked bacon as a bookmark might damage our favorite copy of Moby Dick, or The Whale. Using a piece of duct tape, similarly, requires some care before trying it.
Note that even something as safe-seeming as a bookmark...