Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!njin!princeton!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.software-eng Subject: Re: Reusability considered harmful??(!!) Message-ID: <12397@pucc.Princeton.EDU> Date: 1 Feb 91 22:19:47 GMT References: <4639@mindlink.UUCP> Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 40 Disclaimer: Author bears full responsibility for contents of this article In article <4639@mindlink.UUCP>, Nick_Janow@mindlink.UUCP (Nick Janow) writes: > >EGNILGES@pucc.Princeton.EDU (Ed Nilges) writes: > >> "Reusable" software components are very often ugly to use because they do >> more at run time than the potential reuser wants them to do. > >Forth, with its low overhead for words (modules/subroutines), encourages reuse I suppose that languages with spontaneous (that is, nonexistent) declarations of variables encourage reuse, and FORTRAN is a case in point. REXX is another such language and it is easy to write and to use reusable modules in REXX. However, I believe a theory of reusability has to come from outside the bits and bytes of programming languages. A function makes sense as a reusable tool when you can explain it in a simple (no compound phrases) English sentence to a non-computer user. Examples: This function returns the square root of its argument This function returns the nth root of its argument Calculate net pay from gross pay and deductions Produce voice stress analysis from waveform Identify out of balance tank condition . . . Even in the realm of systems programming (producing functions for other programmers) this rule applies, as long as the reusable function is describable in terms that make sense, not just to the function maker but also to the function user. I believe that this simple rule provides a quasi sort of metric by means of which you can distinguish good, modular code from what the French would call "bricolage", or patchwork, worse in its way than monolithic code.