Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!tank!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!wsmith From: wsmith@m.cs.uiuc.edu Newsgroups: comp.lang.c++ Subject: Reusable design vs. reusable code Message-ID: <4800046@m.cs.uiuc.edu> Date: 8 Dec 88 18:27:00 GMT Lines: 51 Nf-ID: #N:m.cs.uiuc.edu:4800046:000:2534 Nf-From: m.cs.uiuc.edu!wsmith Dec 8 12:27:00 1988 I would like to contrast two desirable properties of a language: the property that software in the language is reusable, with the property that the software is easily rewriteable so that designs are reusable. I believe both are desirable, but may conflict with each other. To me, reusable software means that implementations may be used for many different purposes. It may be difficult to make the first implementation or the language may have a steep learning curve (as I understand Smalltalk does to an extent) but once it is done, you have an library that may save effort in the future. Another desirable property to me is that the software is rewritable. For this to be true, the effort reused is in the design phase. A design may be implemented in several different ways and each of the effort to make new implementations of the design would be painless in a language with this property. If a algorithm is easy to implement, reimplement, or modify in a language, there are several benefits to be gained: A library of designs may be created that may then be adapted to different uses, which leads to the second point: I think it is easier to reuse designs than implementations. If I have a simple schema (design) for symbol tables and I need to use that design in a slightly different manner for a prototype, it could be much easier to reimplement the modified design than to try to fit an existing C++ or Smalltalk implementation into my new framework. Prototyping will be much easier. The work of making a prototype is to convert a design into a cheap and dirty implementation. By making programs easily implementable, that initial expense is minimized. Later, the same design may be implemented in a more sophisticated manner as profiling and performance monitors indicate that improvements are necessary. At the point where implementation becomes easy enough, a higher level implementation language could be used to guide an automatic generator of lower level code. I believe it will be difficult to develop a language where both reusable designs and reusable code are possible. The problem is capturing all possible modification to a design and mapping them onto parameterizations of a library. At some point, a modified design will force a reimplementation of the library. Unless the reimplementation is made easy, the design won't be very reusable. The effort needed to make code reusable inhibits this goal. Bill Smith wsmith@cs.uiuc.edu uiucdcs!wsmith