<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Kommentare zu: My 5 reasons not to use short variable names anymore</title>
	<atom:link href="http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-5-reasons-not-to-use-short-variable-names-anymore</link>
	<description>Tech Startup Craftsmanship</description>
	<lastBuildDate>Sun, 03 Apr 2016 21:59:00 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.1</generator>
	<item>
		<title>Von: stevej</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-18</link>
		<dc:creator><![CDATA[stevej]]></dc:creator>
		<pubDate>Fri, 14 Dec 2012 17:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-18</guid>
		<description><![CDATA[Long names can make it harder to discern the author&#039;s intention by (over)emphasizing the data locations instead of what the code _does_. 

The problem is worsened when programmers invent lousy names for things as we often do. The bloated source that results can look more like bad prose than an algorithm. [Consider that the same person who wrote the unhelpful comments --if they did-- probably picked the names too.]

This can be ameliorated, as others here have pointed out, by using short names for short-lived, locally-scoped variables.  Readability can be further improved through judicious use of &quot;negative space,&quot; that is whitespace and anonymous functions and/or objects. In other words, pitch the names altogether. As example, FP-style encourages this.

A style guideline that helps is to require devs to write short and simple classes and functions. This embodiment of the &quot;Single Responsibility Principle&quot; (SRP) produces decent names in my experience. Code review enforcement will help too.]]></description>
		<content:encoded><![CDATA[<p>Long names can make it harder to discern the author&#8217;s intention by (over)emphasizing the data locations instead of what the code _does_. </p>
<p>The problem is worsened when programmers invent lousy names for things as we often do. The bloated source that results can look more like bad prose than an algorithm. [Consider that the same person who wrote the unhelpful comments --if they did-- probably picked the names too.]</p>
<p>This can be ameliorated, as others here have pointed out, by using short names for short-lived, locally-scoped variables.  Readability can be further improved through judicious use of &#8220;negative space,&#8221; that is whitespace and anonymous functions and/or objects. In other words, pitch the names altogether. As example, FP-style encourages this.</p>
<p>A style guideline that helps is to require devs to write short and simple classes and functions. This embodiment of the &#8220;Single Responsibility Principle&#8221; (SRP) produces decent names in my experience. Code review enforcement will help too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Bubba</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-17</link>
		<dc:creator><![CDATA[Bubba]]></dc:creator>
		<pubDate>Fri, 14 Dec 2012 16:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-17</guid>
		<description><![CDATA[I never cared about people maintaining my code in the future, until I realized that I forget a lot, and I&#039;m one of the people that need the clarity to maintain my own code in the future.]]></description>
		<content:encoded><![CDATA[<p>I never cared about people maintaining my code in the future, until I realized that I forget a lot, and I&#8217;m one of the people that need the clarity to maintain my own code in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Dennis Suitters</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-16</link>
		<dc:creator><![CDATA[Dennis Suitters]]></dc:creator>
		<pubDate>Fri, 27 Aug 2010 11:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-16</guid>
		<description><![CDATA[Even though using legible and self explanatory variable names makes for semantic and easy to read and decipher code, it can lead to longer processing times on servers for scripting like PHP, ASP, or Python (there&#039;s prob more, those are just examples).

When it comes to processing large amounts of sql queries or data in general, I&#039;ve found short at the most 3 char length variables work well. And watching memory stats on my hosting server when processing pages, reusing variable names helps to keep memory overhead low. For e.g. I might use $s to do a sql query, and then use $r on the fetch array loop, then if other parts in the same page/script need to make fetch array and sql query calls, i&#039;ll use $s and $r again.

On a slightly different note. I&#039;ve noticed by watching cpu load times and memory overhead on a local machine when referencing array especially, if you use for e.g. $r[name] as a reference in the array to work with that data, is slower than using $r[4] to reference the same data, obviously 4 would be the 4th position where name coincides within the array.

I originally started using short var names to save document space and to keep file size down, just as removing all white space does, and studying the speed difference, the change can be quite dramatic, for not only speed, but file size. Just think, if you have your code tabulated, and spaced out, which is great for readability, but not for overall performance.]]></description>
		<content:encoded><![CDATA[<p>Even though using legible and self explanatory variable names makes for semantic and easy to read and decipher code, it can lead to longer processing times on servers for scripting like PHP, ASP, or Python (there&#8217;s prob more, those are just examples).</p>
<p>When it comes to processing large amounts of sql queries or data in general, I&#8217;ve found short at the most 3 char length variables work well. And watching memory stats on my hosting server when processing pages, reusing variable names helps to keep memory overhead low. For e.g. I might use $s to do a sql query, and then use $r on the fetch array loop, then if other parts in the same page/script need to make fetch array and sql query calls, i&#8217;ll use $s and $r again.</p>
<p>On a slightly different note. I&#8217;ve noticed by watching cpu load times and memory overhead on a local machine when referencing array especially, if you use for e.g. $r[name] as a reference in the array to work with that data, is slower than using $r[4] to reference the same data, obviously 4 would be the 4th position where name coincides within the array.</p>
<p>I originally started using short var names to save document space and to keep file size down, just as removing all white space does, and studying the speed difference, the change can be quite dramatic, for not only speed, but file size. Just think, if you have your code tabulated, and spaced out, which is great for readability, but not for overall performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Till</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-15</link>
		<dc:creator><![CDATA[Till]]></dc:creator>
		<pubDate>Fri, 13 Aug 2010 06:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-15</guid>
		<description><![CDATA[Guys, don&#039;t forget last point! Yes there may be exceptions for rules when a variable does not live longer than two lines and so on ... But I totally agree with that last point: &quot;... you don’t write that piece of code for yourself and for right now. ...&quot; Whether you code in a nice modern language or an obsolete old language like Basic. You should always keep that last rule in mind. Have the discipline to write clean code!]]></description>
		<content:encoded><![CDATA[<p>Guys, don&#8217;t forget last point! Yes there may be exceptions for rules when a variable does not live longer than two lines and so on &#8230; But I totally agree with that last point: &#8220;&#8230; you don’t write that piece of code for yourself and for right now. &#8230;&#8221; Whether you code in a nice modern language or an obsolete old language like Basic. You should always keep that last rule in mind. Have the discipline to write clean code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: kebomix</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-14</link>
		<dc:creator><![CDATA[kebomix]]></dc:creator>
		<pubDate>Sun, 08 Aug 2010 21:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-14</guid>
		<description><![CDATA[totally agree , great post :-)]]></description>
		<content:encoded><![CDATA[<p>totally agree , great post <img src="http://blog.hendrikbeck.com/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley" /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Twitted by viirya</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-13</link>
		<dc:creator><![CDATA[Twitted by viirya]]></dc:creator>
		<pubDate>Thu, 05 Aug 2010 10:14:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-13</guid>
		<description><![CDATA[[...] This post was Twitted by viirya [...] ]]></description>
		<content:encoded><![CDATA[<p>[...] This post was Twitted by viirya [...] </p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: mario</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-12</link>
		<dc:creator><![CDATA[mario]]></dc:creator>
		<pubDate>Thu, 05 Aug 2010 00:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-12</guid>
		<description><![CDATA[I&#039;ll try to remind myself of this. However, it&#039;s not appropriate in ALL cases and languages. Especially for Python and list comprehensions it doesn&#039;t make sense to use lengthy names for very temporary data holders [r.title for r in self.fetchThingys()].]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ll try to remind myself of this. However, it&#8217;s not appropriate in ALL cases and languages. Especially for Python and list comprehensions it doesn&#8217;t make sense to use lengthy names for very temporary data holders [r.title for r in self.fetchThingys()].</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Hendrik Beck</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-11</link>
		<dc:creator><![CDATA[Hendrik Beck]]></dc:creator>
		<pubDate>Wed, 04 Aug 2010 03:14:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-11</guid>
		<description><![CDATA[Thanks for your comments!

@Eric: Yeah, sure we should distinguish between cases and I&#039;d buy the general rule you suggested right away. But then again, if I&#039;m trying to advocate a change in style then I find it easier to advocate a complete change and to be more strict, even about short-living variables. We know that it won&#039;t be respected 100% of the time anyways.

I&#039;m also a big fan of re-factoring big methods into smaller ones although not only for code style and readability nor for maintainability or re-usability, but for testability reasons. Just so much easier to write some quick JUnit tests for separate methods.]]></description>
		<content:encoded><![CDATA[<p>Thanks for your comments!</p>
<p>@Eric: Yeah, sure we should distinguish between cases and I&#8217;d buy the general rule you suggested right away. But then again, if I&#8217;m trying to advocate a change in style then I find it easier to advocate a complete change and to be more strict, even about short-living variables. We know that it won&#8217;t be respected 100% of the time anyways.</p>
<p>I&#8217;m also a big fan of re-factoring big methods into smaller ones although not only for code style and readability nor for maintainability or re-usability, but for testability reasons. Just so much easier to write some quick JUnit tests for separate methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Bogdan Marian</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-10</link>
		<dc:creator><![CDATA[Bogdan Marian]]></dc:creator>
		<pubDate>Tue, 03 Aug 2010 14:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-10</guid>
		<description><![CDATA[Very well said!
I totally agree with these points.]]></description>
		<content:encoded><![CDATA[<p>Very well said!<br />
I totally agree with these points.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Eric Giese</title>
		<link>http://blog.hendrikbeck.com/2010/08/03/my-5-reasons-not-to-use-short-variable-names-anymore/#comment-9</link>
		<dc:creator><![CDATA[Eric Giese]]></dc:creator>
		<pubDate>Tue, 03 Aug 2010 14:07:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.hendrikbeck.com/?p=167#comment-9</guid>
		<description><![CDATA[You have a point, but that mostly yields for field names, in my opinion.
In general, have gotten lazy over the years and now i am using (in java) only the camel cases for short lived variable, so FileInputStream is fis.

Why? Because that object won&#039;t live for more than 2 lines.

The general rule should be like this:

Short-living / small scope: 
3- identifier is enough, if the code is written well enough to be self-explanatory. Otherwise, add comments.

Long-living field / huge method: 
Needs a full qualified name. However, writing methods with more than 30 lines is a vast crime by itself. Rather than introducing long variables, I tend to refactor these beasts into smaller, well defined methods with meaninful names.

Good functional-oriented and reusable design is usually preferably well documented, but long and quirky imperative code. Even in languages like Java.]]></description>
		<content:encoded><![CDATA[<p>You have a point, but that mostly yields for field names, in my opinion.<br />
In general, have gotten lazy over the years and now i am using (in java) only the camel cases for short lived variable, so FileInputStream is fis.</p>
<p>Why? Because that object won&#8217;t live for more than 2 lines.</p>
<p>The general rule should be like this:</p>
<p>Short-living / small scope:<br />
3- identifier is enough, if the code is written well enough to be self-explanatory. Otherwise, add comments.</p>
<p>Long-living field / huge method:<br />
Needs a full qualified name. However, writing methods with more than 30 lines is a vast crime by itself. Rather than introducing long variables, I tend to refactor these beasts into smaller, well defined methods with meaninful names.</p>
<p>Good functional-oriented and reusable design is usually preferably well documented, but long and quirky imperative code. Even in languages like Java.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
