<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Obscurata Craptacula comments on Crummy Variable Naming Not Restricted to Lousy Source Code</title>
    <link>http://blogs.purpleiguanasoftware.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Obscurata Craptacula comments</description>
    <item>
      <title>"Crummy Variable Naming Not Restricted to Lousy Source Code" by jerryk</title>
      <description>&lt;p&gt;Have you ever tried to read source code littered with variables that have undescriptive names like &lt;em&gt;i&lt;/em&gt;, &lt;em&gt;ii&lt;/em&gt;, &lt;em&gt;i0&lt;/em&gt;, &lt;em&gt;ii0&lt;/em&gt;, &lt;em&gt;temp&lt;/em&gt;, &lt;em&gt;temp1&lt;/em&gt;, &lt;em&gt;temp2&lt;/em&gt;, and so on?  Such names are arguably concise and tolerable in some circumstances such as when:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;The symbol is being used for something of very &lt;em&gt;low conceptual weight&lt;/em&gt;, e.g. an index of iteration that&amp;#8217;s no more than a dummy variable that hardly deserves a name, and whose purpose is little more than walking over some simply indexed set of values.&lt;/li&gt;
		&lt;li&gt;When the use of the symbol is &lt;em&gt;highly local&lt;/em&gt;. Hopefully its scope is restricted to the body of a small loop, or other relatively compact code block, and it&amp;#8217;s not even visible outside of it.&lt;/li&gt;
		&lt;li&gt;When in some other context, &lt;em&gt;hopefully widely known by your audience&lt;/em&gt;, those symbols are universally used as you&amp;#8217;re using them.  Denoting coordinates in the plane with variations on x and y is probably familiar to everybody.  In other cases you may want to be more explicit and careful.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;When variables with ultra-terse, non-descriptive names are used in the absence of these conditions, code gets much harder to read.  Its meaning is less clear on initial inspection, and maintaining a sense of it burdens the working memory of the reader.&lt;/p&gt;


	&lt;p&gt;It turns out that annoying source code isn&amp;#8217;t the only place this happens.  I was recently reading something, which will be left unnamed to protect the guilty, that contained roughly the following passage:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;The system has three eigenvalues:  one positive, one zero, one negative.  Let us call them alpha, mu, and upsilon respectively.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Alpha, mu and upsilon?  &lt;span class="caps"&gt;WTF&lt;/span&gt;, man?  Are you &lt;em&gt;trying&lt;/em&gt; to annoy the reader, when five pages from now, you next refer to these quantities?  Here&amp;#8217;s a suggestion!  Why don&amp;#8217;t we assign the one with value zero the convenient name &amp;#8220;zero?&amp;#8221;  I vaguely remember that the Arabs of antiquity even provided a convenient notation for this quantity.  I believe it was some kind of circle.  It&amp;#8217;s an amusing exercise to come up with less useless names for the other two eigenvalues.&lt;/p&gt;


	&lt;p&gt;And lower-case upsilon?  Maybe there&amp;#8217;s a reason people often avoid using that particular letter in written mathematics&amp;#8230;  especially in &lt;em&gt;handwritten&lt;/em&gt; mathematics?  Seeing a whiteboard full of sloppily rendered u&amp;#8217;s, v&amp;#8217;s, upsilons, and the uppercase counterparts of the first two is a strong predictor of a plunge into the dunk tank of tortured exposition.&lt;/p&gt;


	&lt;p&gt;But what do I know?  I just write one cranky post every three months, and it&amp;#8217;s generally devoid of u&amp;#8217;s, v&amp;#8217;s, upsilons (to say nothing of interesting content).&lt;/p&gt;

</description>
      <pubDate>Mon, 11 Sep 2006 08:56:00 PDT</pubDate>
      <guid>&lt;a href="/articles/2006/09/11/crummy-variable-naming-not-restricted-to-lousy-source-code"&gt;Crummy Variable Naming Not Restricted to Lousy Source Code&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2006/09/11/crummy-variable-naming-not-restricted-to-lousy-source-code"&gt;Crummy Variable Naming Not Restricted to Lousy Source Code&lt;/a&gt;</link>
    </item>
  </channel>
</rss>

