Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Rewrite (programming)

From Wikipedia, the free encyclopedia
Concept in programming
This article is about a complete or significant code change that may involve behavior changes; it is not to be confused withCode refactoring.

Incomputer programming,rewrite is the act of authoring newsource code to replace an existingcodebase from scratch (atotal rewrite) or to significantly modify an existing codebase such that the resulting code maintains essential aspects of the original. The essential aspects to be maintained for a rewrite effort may differ but often include behavior, performance and interface. The result of the effort is also called arewrite.

Motivations

[edit]

Common motivations for rewriting software include:

  • The source code is not available or is protected by an incompatible license.
  • The code cannot be adapted to a new target platform; perhaps a differentprogramming language must be used, since there is no support for the original code on the target platform.
  • The code is too difficult to understand, maintain, extend ordebug.
  • There is a desire to use new techniques or technologies, especially when desired enhancements would require significant change.

Risks

[edit]

Some warn against a total rewrite, especially under schedule constraints or competitive pressures.[1] 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 orregressions of previously fixed bugs.[2][1] A rewrite also interferes with the tracking of unfixed bugs in the old version.[3]

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.[4]

Examples

[edit]

Netscape's project to improve HTML layout inNavigator 4 has been cited as an example of a failed rewrite. The new layout engine (Gecko) had developed independently of 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 focused on incremental improvements toInternet Explorer and did not face the same obstacles.[1][5]

See also

[edit]

References

[edit]
  1. ^abcSpolsky, Joel (6 April 2000)."Things You Should Never Do, Part I".Joel on Software. Retrieved2015-01-23.
  2. ^Ronkes Agerbeek, Joost (April 15, 2005)."Never Rewrite Code From Scratch". Archived fromthe original on October 10, 2008. Retrieved2008-09-11.
  3. ^Zawinski, Jamie."Cascade of Attention-Deficit Teenagers". Retrieved2008-09-11.
  4. ^Tilly, Ben (September 29, 2001)."Rewriting, from scratch, a huge code base". Retrieved2008-09-11.
  5. ^Zawinski, Jamie (March 31, 1999)."resignation and postmortem". Retrieved2008-09-11.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Rewrite_(programming)&oldid=1328332148"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp