<story><title>Ask HN: Anyone know any funny programming jokes?</title><text>Can be super esoteric or super generalized, I love it when I get them, or when I just learn something new.</text></story><parent_chain><item><author>gumby</author><text>This is an oldie (I first heard it in the 80s) but is one of my all time favorites.  While it can be told about any two classes of people it really applies to a lot of code I encounter:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  A physicist is showing a thermos to her friend, a programmer.

  &amp;quot;It&amp;#x27;s amazing&amp;quot;, she said.  &amp;quot;You put a cold drink inside and regardless of how hot it is outside the drink stays cold&amp;quot;.

  The programmer is suitably impressed.

  &amp;quot;But that&amp;#x27;s not all&amp;quot;, she continued.  &amp;quot;You can put a *hot* drink inside and no matter how cold it is outside the drink stays hot&amp;quot;.

  Now the programmer is perplexed.

  Plaintively he asks, &amp;quot;But how does it know?&amp;quot;

&lt;/code&gt;&lt;/pre&gt;
I think of this whenever I read code that contains a gratuitous state variable that explains the type or content of some data structure rather than make the data structure self-explaining.  Even more annoying when it&amp;#x27;s a class.&lt;p&gt;Having to coordinate &lt;i&gt;two&lt;/i&gt; variables is a recipe for bugs down the road.  Seems like it should be a beginner&amp;#x27;s mistake but I see it all the time in &amp;quot;non beginner&amp;quot; code.</text></item></parent_chain><comment><author>randcraw</author><text>I first heard this joke at an AI conference...&lt;p&gt;&amp;quot;An engineer, a physicist, a mathematician, and an AI researcher were asked to name the greatest invention of all time.&lt;p&gt;The engineer chose fire, which gave humanity power over matter. The physicist chose the wheel, which gave humanity the power over space. The mathematician chose the alphabet, which gave humanity power over symbols. The AI researcher chose the thermos bottle.&lt;p&gt;&amp;quot;Why a thermos bottle?&amp;quot; the others asked. &amp;quot;Because the thermos keeps hot liquids hot in winter and cold liquids cold in summer.&amp;quot;, said the AI researcher.  &amp;quot;Yes - so what?&amp;quot; &amp;quot;Think about it.&amp;quot;, intoned the researcher reverently. &amp;quot;That little bottle - how does it know?&amp;quot;</text></comment>
<story><title>Ask HN: Anyone know any funny programming jokes?</title><text>Can be super esoteric or super generalized, I love it when I get them, or when I just learn something new.</text></story><parent_chain><item><author>gumby</author><text>This is an oldie (I first heard it in the 80s) but is one of my all time favorites.  While it can be told about any two classes of people it really applies to a lot of code I encounter:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  A physicist is showing a thermos to her friend, a programmer.

  &amp;quot;It&amp;#x27;s amazing&amp;quot;, she said.  &amp;quot;You put a cold drink inside and regardless of how hot it is outside the drink stays cold&amp;quot;.

  The programmer is suitably impressed.

  &amp;quot;But that&amp;#x27;s not all&amp;quot;, she continued.  &amp;quot;You can put a *hot* drink inside and no matter how cold it is outside the drink stays hot&amp;quot;.

  Now the programmer is perplexed.

  Plaintively he asks, &amp;quot;But how does it know?&amp;quot;

&lt;/code&gt;&lt;/pre&gt;
I think of this whenever I read code that contains a gratuitous state variable that explains the type or content of some data structure rather than make the data structure self-explaining.  Even more annoying when it&amp;#x27;s a class.&lt;p&gt;Having to coordinate &lt;i&gt;two&lt;/i&gt; variables is a recipe for bugs down the road.  Seems like it should be a beginner&amp;#x27;s mistake but I see it all the time in &amp;quot;non beginner&amp;quot; code.</text></item></parent_chain><comment><author>kilnr</author><text>Love the joke, but to me it points to something else than gratuitous state variables. I think of it as &amp;quot;if all you have is a hammer, everything looks like a nail&amp;quot;, with the hammer being &amp;quot;procedurally solving problems&amp;quot;.</text></comment>