HOME

TheInfoList



OR:

A rewrite in
computer programming Computer programming is the process of performing a particular computation (or more generally, accomplishing a specific computing result), usually by designing and building an executable computer program. Programming involves tasks such as anal ...
is the act or result of re-implementing a large portion of existing functionality without re-use of its
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
. When the rewrite is not using existing code at all, it is common to speak of a rewrite from scratch.


Motivations

A piece of software is typically rewritten when one or more of the following apply: *its source code is not available or is only available under an incompatible
license A license (or licence) is an official permission or permit to do, use, or own something (as well as the document of that permission or permit). A license is granted by a party (licensor) to another party (licensee) as an element of an agreeme ...
*its code cannot be adapted to a new target platform *its existing code has become too difficult to handle and extend *the task of
debugging In computer programming and software development, debugging is the process of finding and resolving '' bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems. Debugging tactics can involve i ...
it seems too complicated *the programmer finds it difficult to understand its source code *developers learn new techniques or wish to do a big feature overhaul which requires much change *developers learn that new codes written may extend content options that can fix or overwrite previous problems *the
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
of the source code has to be changed


Risks

Several software engineers, such as Joel Spolsky have warned against total rewrites, especially under schedule constraints or competitive pressures. While developers may initially welcome the chance to correct historical design mistakes, a rewrite also discards those parts of the design that work as required. A rewrite commits the development team to deliver not just new features, but all those that exist in the previous code, while potentially introducing new bugs or regressions of previously fixed bugs. A rewrite also interferes with the tracking of unfixed bugs in the old version. The incremental rewrite is an alternative approach, in which developers gradually replace the existing code with calls into a new implementation, expanding that implementation until it fully replaces the old one. This approach avoids a broad loss of functionality during the rewrite. Cleanroom software engineering is another approach, which requires the team to work from an exhaustive written specification of the software's functionality, without access to its code.


Examples

Netscape's project to improve HTML layout in
Navigator A navigator is the person on board a ship or aircraft responsible for its navigation.Grierson, MikeAviation History—Demise of the Flight Navigator FrancoFlyers.org website, October 14, 2008. Retrieved August 31, 2014. The navigator's prima ...
4 has been cited as an example of a failed rewrite. The new layout engine (
Gecko Geckos are small, mostly carnivorous lizards that have a wide distribution, found on every continent except Antarctica. Belonging to the infraorder Gekkota, geckos are found in warm climates throughout the world. They range from . Geckos a ...
) had developed independently from Navigator and did not integrate readily with Navigator's code; hence Navigator itself was rewritten around the new engine, breaking many existing features and delaying release by several months. Meanwhile,
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
focused on incremental improvements to
Internet Explorer Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated IE or MSIE) is a series of graphical web browsers developed by Microsoft which was used in the Windows line of operating systems (in ...
and did not face the same obstacles. Ironically, Navigator itself was a successful cleanroom rewrite of NCSA Mosaic overseen by that program's developers. See Browser wars.


See also

*
Code refactoring In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the '' factoring''—without changing its external behavior. Refactoring is intended to improve the design, structu ...
* Open source software development * Technical debt *
Development hell Development hell, development purgatory, and development limbo are Media industry, media and Software industry, software industry jargon for a project, concept, or idea that remains in development for an especially long time, often moving between d ...
* Porting * Game engine recreation Some projects mentioning major rewrites in their history: *
Apache HTTP Server The Apache HTTP Server ( ) is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache S ...
(1) * AOL Instant Messenger (1) * BIND (1) * Freenet (1) * Fusebox (2) * GRUB (1) * Majordomo (1) *
MediaWiki MediaWiki is a free and open-source wiki software. It is used on Wikipedia and almost all other Wikimedia websites, including Wiktionary, Wikimedia Commons and Wikidata; these sites define a large part of the requirement set for Media ...
(1) * Mozilla/Netscape (1) * Icecast (0–1) * netcat (1) * OpenRPG (1) * PHP (1–2) * Project Xanadu (0–1) *
Sun Secure Global Desktop Oracle Secure Global Desktop (SGD) software provides secure access to both published applications and published desktops running on Microsoft Windows, Unix, mainframe and IBM i systems via a variety of clients ranging from fat PCs to thin clients su ...
(1) * vBulletin (2) * WebObjects (1) * Zope (1)


References

{{reflist, 30em


External links


RewriteCodeFromScratch at C2 Wiki
by Joel Spolsky Computer programming