Version 0 of Techniques for making code reuse easier

Updated 2006-04-07 15:11:42

Purpose: discuss techniques developers use to make code reuse easier.

  1. What is code reuse? Code reuse is one dream of some developers. It is the concept of writing code once, then using it in various other applications. In other industries (such as architecture, construction, automobile construction, food preparation) reuse of pre-constructed components is not only taken for granted, but critical for successful, safe construction.
  2. What makes code reuse hard? Noticing that the code needed is code already written. Remembering, or locating, the already written code. Finding code that was written in a manner so that it can be reused.
  3. Is code reuse really possible? Yes - Tcl is a prime example of code reuse.
  4. Is code reuse really practical? Yes, but it does take time, effort, and a desire to actually make the code reusable.
  5. What are techniques Tcl developers use to make code reuse easier?
  • The most important technique needed is the desire to actually use, and write, reusable code. Without that, nothing else will make significant impact.
  • Next, one must become aware of what code already has been written. There are large numbers of extensions that have already been written. However, there really isn't one single way to browse all of the code to determine what is available. Certainly many pages have been written on http://wiki.tcl.tk/ and at one time pages were available at http://www.tcl.tk/ and other sites attempting to catalog the extensions. And one can use any of the search engines covering large segments of development web sites, looking for discussions.
  • Once the preceeding techniques have been implemented, one needs to become aware, when designing code, of potential reusable components of the design. One then looks around to see if such components already exist. If so, then one makes use of them.
  • If a potentially reusable component is needed, but does not exist, then one is faced with the possibility of designing, implementing, and deploying a new component.

[Add details of things to consider when designing, implementing, and deploying new reusable components. Include design considerations, documentation, techniques to use and avoid when writing the code, and methods of distribution and advertising the new component.]


Category Discussion