<?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>Comments on: In Defense of the _Underscore</title>
	<atom:link href="http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/feed/" rel="self" type="application/rss+xml" />
	<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/</link>
	<description>keepin' it real... real simple.</description>
	<lastBuildDate>Wed, 17 Feb 2010 01:27:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ted</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-86</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Thu, 20 Aug 2009 20:00:06 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-86</guid>
		<description>You are free to use whatever style you like in your code.  

Pascal / Camel casing have only recently come about in the last 10 years and are unlikely to be a permanent standard.  

I work within each of the coding standards I&#039;ve had to follow and generally resort to using single word variable, parameter, identifer names to avoid the underscore, pascal casing, camel casing, etc argument.

Commonly, I&#039;ve seen first and second year out of college developers having a hard time reading anyone elses code especially if the style is not what they are used to.

Some examples of this:

Local variables:
 - prefixed with l_
 - prefixed iwth _
 - all lowercase (global variables in caps)
 - prefixed with m_ for member variables
 - prefixed with lower case i or m
 - prefixed with LOCAL_
 - prefixed with local

Refactoring and reordering your code will be more beneficial than fighting about variable naming schemes.

For example: 

Providing a constructor with no arguments and then forcing uses to set all of the member variables one at a time even though the class cannot be properly initialized/constructed without setting all of the member variables.  This is often done to run a class in some automated unit test runner.  This should be refactored itno a constructor that forces values for all of the member variables to be passed in to ensure that any construction of the object results in a fully constructed object.

Example 2:  Providing a save to xml method in an object as well as a load from XML even though the object will never be loaded from XML.</description>
		<content:encoded><![CDATA[<p>You are free to use whatever style you like in your code.  </p>
<p>Pascal / Camel casing have only recently come about in the last 10 years and are unlikely to be a permanent standard.  </p>
<p>I work within each of the coding standards I&#8217;ve had to follow and generally resort to using single word variable, parameter, identifer names to avoid the underscore, pascal casing, camel casing, etc argument.</p>
<p>Commonly, I&#8217;ve seen first and second year out of college developers having a hard time reading anyone elses code especially if the style is not what they are used to.</p>
<p>Some examples of this:</p>
<p>Local variables:<br />
 &#8211; prefixed with l_<br />
 &#8211; prefixed iwth _<br />
 &#8211; all lowercase (global variables in caps)<br />
 &#8211; prefixed with m_ for member variables<br />
 &#8211; prefixed with lower case i or m<br />
 &#8211; prefixed with LOCAL_<br />
 &#8211; prefixed with local</p>
<p>Refactoring and reordering your code will be more beneficial than fighting about variable naming schemes.</p>
<p>For example: </p>
<p>Providing a constructor with no arguments and then forcing uses to set all of the member variables one at a time even though the class cannot be properly initialized/constructed without setting all of the member variables.  This is often done to run a class in some automated unit test runner.  This should be refactored itno a constructor that forces values for all of the member variables to be passed in to ensure that any construction of the object results in a fully constructed object.</p>
<p>Example 2:  Providing a save to xml method in an object as well as a load from XML even though the object will never be loaded from XML.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jef Newsom</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-59</link>
		<dc:creator>Jef Newsom</dc:creator>
		<pubDate>Fri, 24 Jul 2009 21:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-59</guid>
		<description>If everyone on the team believes that using _underscores is a great_ idea, then &quot;When in Rome...&quot; 

If you have existing standards or conventions and don&#039;t get buy in from the team to change them, then perhaps you need to make a stronger case or just subvert your will to the desires of the team.</description>
		<content:encoded><![CDATA[<p>If everyone on the team believes that using _underscores is a great_ idea, then &#8220;When in Rome&#8230;&#8221; </p>
<p>If you have existing standards or conventions and don&#8217;t get buy in from the team to change them, then perhaps you need to make a stronger case or just subvert your will to the desires of the team.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-58</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 24 Jul 2009 20:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-58</guid>
		<description>The points are relevant, but beauty is in the eye of the beholder (or developer in this case).  Agree to disagree?</description>
		<content:encoded><![CDATA[<p>The points are relevant, but beauty is in the eye of the beholder (or developer in this case).  Agree to disagree?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jef Newsom</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-57</link>
		<dc:creator>Jef Newsom</dc:creator>
		<pubDate>Fri, 24 Jul 2009 20:36:31 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-57</guid>
		<description>On the point of whether my last points made a relevant point, please allow me to point you to a note on the impact of aesthetics. I believe it is on point.
 
http://www.alistapart.com/articles/indefenseofeyecandy</description>
		<content:encoded><![CDATA[<p>On the point of whether my last points made a relevant point, please allow me to point you to a note on the impact of aesthetics. I believe it is on point.</p>
<p><a href="http://www.alistapart.com/articles/indefenseofeyecandy" rel="nofollow">http://www.alistapart.com/articles/indefenseofeyecandy</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-56</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 24 Jul 2009 19:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-56</guid>
		<description>Jef,

You didn&#039;t really think that I was going to let you have the last work on this, did you?  Let&#039;s go point by point.

10. There is already a language feature that allows you to scope Intellisense to the current object. &lt;b&gt;I assume you are referring to the &quot;this&quot; keyword.  &quot;this&quot; will give you &lt;em&gt;all&lt;/em&gt; all of the members of the containing class.  As far as I know, there is no &quot;baked-in&quot; Intellisense feature that will give you only the private member fields.&lt;/b&gt;

9. The underscore is an awkward key combination on the top row and requires a shift-key. It is especially awkward for left-handers like me, which means that my life expectancy decreases by maintaining your code. &lt;b&gt;This is a bit of a stretch (no pun intended), don&#039;t you think? ;)&lt;/b&gt;

8. Personally, it interrupts the flow when reading code rather than enhancing it.  &lt;b&gt;Initially, maybe.  However, after using it consistently, I have found that it actually improves the readability of my code, providing additional context in a relatively unobtrusive fashion.&lt;/b&gt;

7. You don’t receive as much negative feedback when your methods are too long.  &lt;b&gt;Can you be more specific?&lt;/b&gt;

6. I don’t ever, ever (EVER) find myself wondering, “hmmm, is this variable a parameter or a field?”  &lt;b&gt;As hard as we try, we can&#039;t all be Jef Newsom ;)&lt;/b&gt;

5. I don’t make mistakes, so your third point is irrelevant.  &lt;b&gt;See my response to your sixth point.&lt;/b&gt;

4. You make it really fun to take the opposing view.  &lt;b&gt;I&#039;ll take that as a compliment.&lt;/b&gt;

3. It makes the code ugly. &lt;b&gt;Weak.&lt;/b&gt;

2. Really ugly.  &lt;b&gt;Really weak.&lt;/b&gt;

1. _really, really_ ugly_. &lt;b&gt;_Really, really_ weak_.&lt;/b&gt;

As far as the near-perfect code symmetry is concerned, that&#039;s just a pleasant side effect.  Your serve.

Kind Regards,
Casey.</description>
		<content:encoded><![CDATA[<p>Jef,</p>
<p>You didn&#8217;t really think that I was going to let you have the last work on this, did you?  Let&#8217;s go point by point.</p>
<p>10. There is already a language feature that allows you to scope Intellisense to the current object. <b>I assume you are referring to the &#8220;this&#8221; keyword.  &#8220;this&#8221; will give you <em>all</em> all of the members of the containing class.  As far as I know, there is no &#8220;baked-in&#8221; Intellisense feature that will give you only the private member fields.</b></p>
<p>9. The underscore is an awkward key combination on the top row and requires a shift-key. It is especially awkward for left-handers like me, which means that my life expectancy decreases by maintaining your code. <b>This is a bit of a stretch (no pun intended), don&#8217;t you think? <img src='http://caseywatson.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </b></p>
<p>8. Personally, it interrupts the flow when reading code rather than enhancing it.  <b>Initially, maybe.  However, after using it consistently, I have found that it actually improves the readability of my code, providing additional context in a relatively unobtrusive fashion.</b></p>
<p>7. You don’t receive as much negative feedback when your methods are too long.  <b>Can you be more specific?</b></p>
<p>6. I don’t ever, ever (EVER) find myself wondering, “hmmm, is this variable a parameter or a field?”  <b>As hard as we try, we can&#8217;t all be Jef Newsom <img src='http://caseywatson.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </b></p>
<p>5. I don’t make mistakes, so your third point is irrelevant.  <b>See my response to your sixth point.</b></p>
<p>4. You make it really fun to take the opposing view.  <b>I&#8217;ll take that as a compliment.</b></p>
<p>3. It makes the code ugly. <b>Weak.</b></p>
<p>2. Really ugly.  <b>Really weak.</b></p>
<p>1. _really, really_ ugly_. <b>_Really, really_ weak_.</b></p>
<p>As far as the near-perfect code symmetry is concerned, that&#8217;s just a pleasant side effect.  Your serve.</p>
<p>Kind Regards,<br />
Casey.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jef Newsom</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-45</link>
		<dc:creator>Jef Newsom</dc:creator>
		<pubDate>Thu, 09 Jul 2009 16:08:49 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-45</guid>
		<description>_Thanks _for _posting this_! _As _the _primary _heckler _in _your _use _of underscores_, _I&#039;ll _offer _some counterpoints_. 

First, I agree with Wil that is is helpful if you are reading code using a normal text editor and need to differentiate between parameters and fields. I truly needed that capability in 1996 when I was writing C on Unix using VI. That was the best argument for the use in my opinion. 

You also forgot to mention that the real reason that you do it is because of the near-bilateral symmetry. Damn that semi-colon for screwing things up.

_foo = foo_;

I KNOW that that is the REAL reason. 

Now, the arguments against. 

10. There is already a language feature that allows you to scope intellisense to the current object.

9. The underscore is an awkward key combination on the top row and requires a shift-key. It is especially awkward for left-handers like me, which means that my life expectancy decreases by maintaining your code. 

8. Personally, it interrupts the flow when reading code rather than enhancing it. 
 
7. You don&#039;t receive as much negative feedback when your methods are too long.

6. I don&#039;t ever, ever (EVER) find myself wondering, &quot;hmmm, is this variable a parameter or a field?&quot; 

5. I don&#039;t make mistakes, so your third point is irrelevant. 

4. You make it really fun to take the opposing view.

3. It makes the code ugly.

2. Really ugly.

1. _really, really_ ugly_.

Love, 
Jef</description>
		<content:encoded><![CDATA[<p>_Thanks _for _posting this_! _As _the _primary _heckler _in _your _use _of underscores_, _I&#8217;ll _offer _some counterpoints_. </p>
<p>First, I agree with Wil that is is helpful if you are reading code using a normal text editor and need to differentiate between parameters and fields. I truly needed that capability in 1996 when I was writing C on Unix using VI. That was the best argument for the use in my opinion. </p>
<p>You also forgot to mention that the real reason that you do it is because of the near-bilateral symmetry. Damn that semi-colon for screwing things up.</p>
<p>_foo = foo_;</p>
<p>I KNOW that that is the REAL reason. </p>
<p>Now, the arguments against. </p>
<p>10. There is already a language feature that allows you to scope intellisense to the current object.</p>
<p>9. The underscore is an awkward key combination on the top row and requires a shift-key. It is especially awkward for left-handers like me, which means that my life expectancy decreases by maintaining your code. </p>
<p>8. Personally, it interrupts the flow when reading code rather than enhancing it. </p>
<p>7. You don&#8217;t receive as much negative feedback when your methods are too long.</p>
<p>6. I don&#8217;t ever, ever (EVER) find myself wondering, &#8220;hmmm, is this variable a parameter or a field?&#8221; </p>
<p>5. I don&#8217;t make mistakes, so your third point is irrelevant. </p>
<p>4. You make it really fun to take the opposing view.</p>
<p>3. It makes the code ugly.</p>
<p>2. Really ugly.</p>
<p>1. _really, really_ ugly_.</p>
<p>Love,<br />
Jef</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wil Bloodworth</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-37</link>
		<dc:creator>Wil Bloodworth</dc:creator>
		<pubDate>Mon, 29 Jun 2009 00:57:08 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-37</guid>
		<description>Excellent blog Casey.  I am, as you know, a huge proponent of the trailing underscore on method parameter names.  In the &quot;old days&quot;, we did not have the wonderful luxury of intellisense or even the ability to color parameter names a different color than local or global variable names.  Ray Gram&#039;s Source Insight (http://www.SourceInsight.com) changed that for the C++ world but only recently did Visual Studio bring that feature to C#.

No matter what editor you choose, be it VI, Emacs, Notepad, UltraEdit, SourceInsight, or your own hand-rolled version, appending an underscore to parameter names lets you instantly look at a piece of code and know exactly where that variable came from.

Excellent topic Casey!</description>
		<content:encoded><![CDATA[<p>Excellent blog Casey.  I am, as you know, a huge proponent of the trailing underscore on method parameter names.  In the &#8220;old days&#8221;, we did not have the wonderful luxury of intellisense or even the ability to color parameter names a different color than local or global variable names.  Ray Gram&#8217;s Source Insight (<a href="http://www.SourceInsight.com" rel="nofollow">http://www.SourceInsight.com</a>) changed that for the C++ world but only recently did Visual Studio bring that feature to C#.</p>
<p>No matter what editor you choose, be it VI, Emacs, Notepad, UltraEdit, SourceInsight, or your own hand-rolled version, appending an underscore to parameter names lets you instantly look at a piece of code and know exactly where that variable came from.</p>
<p>Excellent topic Casey!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Williams</title>
		<link>http://caseywatson.com/2009/06/28/in-defense-of-the-underscore/comment-page-1/#comment-36</link>
		<dc:creator>Justin Williams</dc:creator>
		<pubDate>Sun, 28 Jun 2009 20:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://caseywatson.com/?p=206#comment-36</guid>
		<description>I had no idea that anyone had debated this practice. I am obviously fairly new in the field, but every mentor I&#039;ve had (3) have been very clear about using the underscore for private member variables and function arguments (more so on private members). I honestly thought it was a standard, much like Camel and Pascal casing for notation uses as well. I&#039;m curious to hear the argument against my _friend. :)</description>
		<content:encoded><![CDATA[<p>I had no idea that anyone had debated this practice. I am obviously fairly new in the field, but every mentor I&#8217;ve had (3) have been very clear about using the underscore for private member variables and function arguments (more so on private members). I honestly thought it was a standard, much like Camel and Pascal casing for notation uses as well. I&#8217;m curious to hear the argument against my _friend. <img src='http://caseywatson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
