Reusing Code

All developers write—or should write—code with reuse in mind. There are many reasons why this is a good idea:

  • Saving time. If it’s written once, don’t write it again.

  • Easier maintenance. Make a change in one place and any code that uses it gets that change automatically.

  • Easier debugging. Fewer copies exist out there that will need to be fixed.

  • Group development. Developers can share code more easily.

Most of the code reuse in this book involves ColdFusion code, but to demonstrate basic reuse, let’s look at a simple example.

Orange Whip Studios is building a Web site, slowly. Figure 9.11 shows a Home page (still being worked on), and Figure 9.12 shows a Contact page (also being worked on).

Figure 9.11. The Home page contains basic ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.