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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.