Path: utzoo!attcan!uunet!cs.utexas.edu!wuarchive!usc!orion.oac.uci.edu!uci-ics!gateway From: schmidt@zola.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c++ Subject: Re: Do class libraries have to be in source form (2 of 4) Message-ID: <256CEFDE.15973@paris.ics.uci.edu> Date: 24 Nov 89 07:38:05 GMT References: <177@taumet.UUCP> <1989Nov22.181203.16204@mentor.com> <1989Nov23.105650.17030@jarvis.csri.toronto.edu> Reply-To: schmidt@zola.ics.uci.edu (Doug Schmidt) Distribution: comp Organization: University of California, Irvine - Dept of ICS Lines: 55 In-reply-to: sjb@cs.toronto.edu (Stephen Bellantoni) In article <1989Nov23.105650.17030@jarvis.csri.toronto.edu>, sjb@cs (Stephen Bellantoni) writes: >If this is true then it may be the death knell for object oriented >programming. [Note: this has certainly been the week to predict the end of OOP..., was there a fire-sale on crystal balls or something? ;-)] >In case (2) you are not re-using code, you are modifying it. If this is >neccessary for making the best use of object oriented code, then OO has >failed in its goal of making code re-usable: it merely makes it easier >to re-use by encouraging a more structured (i.e. easier to modify) style. I believe this terminology conflates two distinct (but related) forms of code reuse: Black-Box reuse and White-Box reuse. Your statements above pertain mostly to Black-Box reuse, i.e., `reusing a source code component without modifying its internals or interface in any manner.' Naturally, if you apply the synecdochical argument that: Black-Box reuse == All reuse your conclusion above is true by definition. However, White-Box reuse, i.e., `selectively reusing source code components by editing portions of their interface or implementation' also facilitates increased programmer productivity and decrease module fault-proneness (I'm speaking mostly from personal experience here, but there are references in the software engineering literature that address these points more empirically). I'm sure most good C++ programmers maintain a library of reusable classes and code templates that are recycled, revised, and refined for each new project (check out the ./etc and ./gperf subdirectories in the GNU libg++ release for some examples of mine). Furthermore, if/when parameterized types and exception handling become part of the official C++ definition class library designers and application programmers will receive increased incentive and support to migrate the results of their ad hoc, `White-Box reusable' hacks into more formal and complete `Black-Box reusable' componentry. I assert that at this stage of OOP's (and C++'s) evolution exploiting both Black- *and* White-Box reuse is healthy and necessary. After all, the main point of software reuse is not to become obsessed with `purity of essence,' but rather to produce higher quality and more reliable software systems at lower costs, Questing Quixotically after the holy-grail of pure Black-Box reuse seems rather counter productive at this stage of development. Before dispensing with OOP it is probably useful to understand exactly what we are dealing with! Doug -- ---------------------------------------- "The fundamental principle of science, the definition almost, is this: the sole test of the validity of any idea is experiment." -- R. P. Feynman