JargonFile/original/html/G/gotcha.html
2014-03-27 18:54:56 +00:00

12 lines
2.3 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>gotcha</title><link rel="stylesheet" href="../../jargon.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"/><link rel="home" href="../index.html" title="The Jargon File"/><link rel="up" href="../G.html" title="G"/><link rel="previous" href="GOSMACS.html" title="GOSMACS"/><link rel="next" href="GPL.html" title="GPL"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gotcha</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="GOSMACS.html">Prev</a> </td><th width="60%" align="center">G</th><td width="20%" align="right"> <a accesskey="n" href="GPL.html">Next</a></td></tr></table><hr/></div><dt><a id="gotcha"/><dt xmlns="" id="gotcha"><b>gotcha</b>: <span xmlns="http://www.w3.org/1999/xhtml" class="grammar">n.</span></dt></dt><dd><p> A <a href="../M/misfeature.html"><i class="glossterm">misfeature</i></a> 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
<a href="../C/C.html"><i class="glossterm">C</i></a> is the fact that <b class="command">if (a=b)
{code;</b>} is syntactically valid and sometimes even correct. It
puts the value of <b class="command">b</b> into <b class="command">a</b> and then executes <b class="command">code</b> if <b class="command">a</b> is
non-zero. What the programmer probably meant was <b class="command">if
(a==b) {code;</b>}, which executes <b class="command">code</b> if <b class="command">a</b> and
<b class="command">b</b> are equal.</p></dd><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="GOSMACS.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="../G.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="GPL.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">GOSMACS </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> GPL</td></tr></table></div></body></html>