Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code reuse
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Overview== {{more citations needed section|date=April 2015}} [[Ad hoc]] code reuse has been practiced from the earliest days of [[computer programming|programming]]. Programmers have always reused sections of code, templates, functions, and procedures. Software reuse as a recognized area of study in software engineering, however, dates only from 1968 when [[Douglas McIlroy]] of [[Bell Labs|Bell Laboratories]] proposed basing the software industry on reusable components. Code reuse aims to save time and resources and reduce [[Redundancy (information theory)|redundancy]] by taking advantage of assets that have already been created in some form within the software product development process.<ref>{{cite web|author1=Lombard Hill Group|title=What Is Software Reuse?|url=http://lombardhill.com/what_reuse.htm|website=lombardhill.com|publisher=Lombard Hill Group|accessdate=22 October 2014|archive-date=23 January 2019|archive-url=https://web.archive.org/web/20190123223128/http://lombardhill.com/What_Reuse.htm|url-status=dead}}</ref> The key idea in reuse is that parts of a [[computer program]] written at one time can be or should be used in the construction of other programs written at a later time. Code reuse may imply the creation of a separately maintained version of the reusable assets. While code is the most common resource selected for reuse, other assets generated during the development cycle may offer opportunities for reuse: software components, test suites, designs, documentation, and so on.<ref>{{cite web|author1=Lombard Hill Group|title=What Is Software Reuse?|url=http://lombardhill.com/what_reuse.htm|accessdate=22 October 2014|archive-date=23 January 2019|archive-url=https://web.archive.org/web/20190123223128/http://lombardhill.com/What_Reuse.htm|url-status=dead}}</ref> The [[Library (computing)|software library]] is a good example of code reuse. Programmers may decide to create internal abstractions so that certain parts of their program can be reused, or may create custom libraries for their own use. Some characteristics that make software more easily reusable are [[Modularity (programming)|modularity]], [[loose coupling]], high [[Cohesion (computer science)|cohesion]], [[information hiding]] and [[separation of concerns]]. For newly written code to use a piece of existing code, some kind of [[interface (computing)|interface]], or means of communication, must be defined. These commonly include a "call" or use of a [[subroutine]], [[Object (computer science)|object]], [[Class (computer science)|class]], or [[Prototype-based programming|prototype]]. In organizations, such practices are formalized and standardized by [[domain engineering]], also known as [[Product Family Engineering|software product line]] engineering. The general practice of using a prior version of an extant program as a starting point for the next version, is also a form of code reuse. Some so-called code "reuse" involves simply copying some or all of the code from an existing program into a new one. While organizations can realize [[time to market]] benefits for a new product with this approach, they can subsequently be saddled with many of the same [[code duplication]] problems caused by [[cut and paste programming]]. Many researchers have worked to make reuse faster, easier, more systematic, and an integral part of the normal process of programming. These are some of the main goals behind the invention of [[object-oriented programming]], which became one of the most common forms of formalized reuse. A somewhat later invention is [[generic programming]]. Another, newer means is to use software "[[Source code generation|generator]]s", programs which can create new programs of a certain type, based on a set of parameters that users choose. Fields of study about such systems are [[generative programming]] and [[metaprogramming]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)