JargonFile/entries/gotcha.txt

12 lines
525 B
Plaintext
Raw Normal View History

2014-04-26 14:52:28 +00:00
gotcha
2014-04-26 15:54:15 +00:00
n. A misfeature of a system, especially a programming language or
environment, that tends to breed bugs or mistakes because it is both
enticingly easy to invoke and completely unexpected and/or unreasonable in
its outcome. For example, a classic gotcha in C is the fact that if (a=b)
{code; } is syntactically valid and sometimes even correct. It puts the
value of b into a and then executes code if a is non-zero. What the
programmer probably meant was if (a==b) {code; }, which executes code if a
and b are equal.