Oxbow code: Difference between revisions

Content deleted Content added
m Minor corrections done
m change source to syntaxhighlight
 
(5 intermediate revisions by 4 users not shown)
Line 1:
{{Mergeto | Unreachable code |discuss=Talk:Unreachable code#Merge proposal |date=December 2008 }}
 
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 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.
 
Line 16 ⟶ 14:
(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])
<sourcesyntaxhighlight lang="Cpp">
static void
as_global_escape(const fn_call& fn)
Line 26 ⟶ 24:
fn.result->set_string(strInput.c_str());
}
</syntaxhighlight>
</source>
In this, "hexdigitsstrHexDigits" is oxbow code (or oxbow data).
 
==See also==
* [[Dead code]]
* [[Unreachable code]]
 
<!--Categories-->