Content deleted Content added
fix short description template |
m →Types of reuse: HTTP to HTTPS for Blogspot |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1:
{{
'''Code reuse''' is the practice of using existing [[source code]] to develop [[software]] instead of writing new code.
Code reuse may be achieved different ways depending on a complexity of a [[programming language]] chosen and range from a lower-level approaches like code [[Cut, copy, and paste|copy-pasting]] (e.g. via [[Snippet (programming)|snippets]]),<ref>{{Cite journal|last1=Selaolo|first1=Karabo|last2=Hlomani|first2=Hlomani|date=2016|title=Towards An Algorithms Ontology Cluster: for Modular Code Reuse and Polyglot Programming|url=https://www.researchgate.net/publication/305144699|journal=Advances in Computer Science|volume=5|pages=63|via=
Code reuse implies dependencies which can make [[Software maintenance|code maintainability]] harder.{{Citation needed|date=February 2023}}
At least one study found that code reuse at the class level reduces [[technical debt]].<ref>{{Cite journal|last1=Feitosa|first1=Daniel|last2=Ampatzoglou|first2=Apostolos|last3=Gkortzis|first3=Antonios|last4=Bibi|first4=Stamatia|last5=Chatzigeorgiou|first5=Alexander|date=September 2020|title=CODE reuse in practice: Benefiting or harming technical debt|url=https://pure.rug.nl/ws/files/128142562/1_s2.0_S0164121220300960_main.pdf|journal=Journal of Systems and Software|language=en|volume=167|
==Overview==
Line 14:
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.
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]].
Line 38:
* External reuse – A team may choose to license a third-party component. Licensing a third-party component typically costs the team 1 to 20 percent of what it would cost to develop internally.<ref>{{cite book |last=McConnell |first=Steve |title=Rapid Development: Taming Wild Software Schedules |year=1996 |publisher=Pearson Education |isbn=978-1-55615-900-8 |url-access=registration |url=https://archive.org/details/rapiddevelopment00mcco }}</ref> The team must also consider the time it takes to find, learn and integrate the component.
Concerning form or structure of reuse, code can be:<ref name="sharednow.blogspot.com">{{cite web |last=Colombo |first=F. |year=2011 |title=It's not just reuse |work=SharedNow.blogspot |url=
* Referenced – The client code contains a reference to reused code, and thus they have distinct life cycles and can have distinct versions.
* Forked – The client code contains a local or private copy of the reused code, and thus they share a single life cycle and a single version.
|