Oxbow code: Difference between revisions

Content deleted Content added
SmackBot (talk | contribs)
m Date/fix the maintenance tags &/or gen fixes
m change source to syntaxhighlight
 
(12 intermediate revisions by 11 users not shown)
Line 3:
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 gonebeen removed, though thesethis areis more commonly called [[unused variables|unused]] or [[unreferenced variable]]s.
 
The term is taken by analogy with [[oxbow lake]]s 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. As in nature, so in code :)
 
== History ==
 
This article's author first heard the term from David C. Wood at the University of Kent at Canterbury
in the mid 1980s.
 
== Examples ==
(from
[http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?rev=1.46&root=gnash&view=markup gnash/server/asobj/Global.cpp 1.46])
<syntaxhighlight lang="Cpp">
<code>
static void
as_global_escape(const fn_call& fn)
{
// List of chars we must convert to escape sequences
const string hexdigitsstrHexDigits = "0123456789ABCDEF";
string inputstrInput = fn.arg(0).to_string();
URL::encode(inputstrInput);
fn.result->set_string(inputstrInput.c_str());
}
</syntaxhighlight>
</code>
In this, "hexdigitsstrHexDigits" is oxbow code (or oxbow data).
 
{{Uncategorized|date=April 2007}}
==See also==
* [[Dead code]]
* [[Unreachable code]]
 
<!--Categories-->
[[Category:Source code]]