Oxbow code

In computer programming, oxbow code refers to fragments of program code that were once needed but which are now never used. Such code is typically formed when a program is modified, either when an item is superseded with a newer version but the old version is not removed, or when an item is removed or replaced, but the item's supporting code is not removed.

Such code is normally removed unless sufficiently amusing or educational.

Similarly, variables and data structures can be left around after the last code that used them has been removed, though these are more commonly called unused or unreferenced variables.

The term is taken by analogy with oxbow lakes, which are formed in nature when a bend in a river becomes so pronounced that the water breaks through from before the bend to after it, making the river straight again. When the sides of the new course silt up, a curved lake is left, disconnected from the main stream.

Examples

Adapted from gnash/server/asobj/Global.cpp 1.46:

static void asGlobalEscape(const FnCall& fn) {
    // List of chars we must convert to escape sequences
    static constexpr string_view hexDigits = "0123456789ABCDEF";
    string input = fn.arg(0).to_string();
    URL::encode(strInput);
    fn.result->set_string(input.c_str());
}

In this, hexDigits is oxbow code (or oxbow data).

See also

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.