<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: The Confusion about &#039;this&#039;</title>
	<atom:link href="http://blog.hexagonstar.com/the-confusion-about-this/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hexagonstar.com/the-confusion-about-this/</link>
	<description>turn-based glory and pixel pleasure</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:41:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: warappa</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-873</link>
		<dc:creator>warappa</dc:creator>
		<pubDate>Thu, 18 Feb 2010 23:00:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-873</guid>
		<description>Hi,
ever tried to write &quot;this&quot; in an anonymous function? This becomes &quot;global&quot; and not your class. Therefore using &quot;this&quot; would lead to an incorrectly behaving code...

Try this (*g*) in the constructor of a Flex app (or with ANY other anonymous event handler):

addEventListener(FlexEvent.CREATION_COMPLETE,
function(e:Event):void
{
	trace(&quot;this: &quot; + this);
});

Just my 2 cents

Lg
warappa</description>
		<content:encoded><![CDATA[<p>Hi,<br />
ever tried to write &#8220;this&#8221; in an anonymous function? This becomes &#8220;global&#8221; and not your class. Therefore using &#8220;this&#8221; would lead to an incorrectly behaving code&#8230;</p>
<p>Try this (*g*) in the constructor of a Flex app (or with ANY other anonymous event handler):</p>
<p>addEventListener(FlexEvent.CREATION_COMPLETE,<br />
function(e:Event):void<br />
{<br />
	trace(&#8220;this: &#8221; + this);<br />
});</p>
<p>Just my 2 cents</p>
<p>Lg<br />
warappa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruy Adorno</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-872</link>
		<dc:creator>Ruy Adorno</dc:creator>
		<pubDate>Mon, 03 Aug 2009 13:55:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-872</guid>
		<description>I remember that &quot;this&quot; used to be a good practice in the old days of as2, but that was a long time ago.
For the people who said they use &quot;this&quot; just to prompt Flex code complete, you can always use CTRL+space.</description>
		<content:encoded><![CDATA[<p>I remember that &#8220;this&#8221; used to be a good practice in the old days of as2, but that was a long time ago.<br />
For the people who said they use &#8220;this&#8221; just to prompt Flex code complete, you can always use CTRL+space.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: P.J. Onori</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-871</link>
		<dc:creator>P.J. Onori</dc:creator>
		<pubDate>Thu, 23 Apr 2009 19:31:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-871</guid>
		<description>I use &#039;this&#039; almost all the time, but only to prompt Flex to code complete. Over the long run, adding &#039;this&#039; saves me a lot of time and typos.</description>
		<content:encoded><![CDATA[<p>I use &#8216;this&#8217; almost all the time, but only to prompt Flex to code complete. Over the long run, adding &#8216;this&#8217; saves me a lot of time and typos.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ihsan</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-870</link>
		<dc:creator>Ihsan</dc:creator>
		<pubDate>Mon, 09 Mar 2009 10:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-870</guid>
		<description>Gee, people, we are not choosing religions here.
&quot;this&quot; is just a tool. It has its uses. Use of it is not and should not be a &quot;choice&quot; but on &quot;purpose&quot;. So I agree with everyone against abuse of it.

As : this.cripples, this.code, this.really.
:)
When coding just for him/herself, one may do anything he/she wishes. But for writing human-readable code (the main purpose of computer languages) which is understandable by other poor human beings like us, the main point is being clear.
Abuse of any coding structure is generally categorized as SOURCE OBFUSCATION.
Abuse of &quot;this&quot; goes into that category IMO.</description>
		<content:encoded><![CDATA[<p>Gee, people, we are not choosing religions here.<br />
&#8220;this&#8221; is just a tool. It has its uses. Use of it is not and should not be a &#8220;choice&#8221; but on &#8220;purpose&#8221;. So I agree with everyone against abuse of it.</p>
<p>As : this.cripples, this.code, this.really. <img src='http://blog.hexagonstar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
When coding just for him/herself, one may do anything he/she wishes. But for writing human-readable code (the main purpose of computer languages) which is understandable by other poor human beings like us, the main point is being clear.<br />
Abuse of any coding structure is generally categorized as SOURCE OBFUSCATION.<br />
Abuse of &#8220;this&#8221; goes into that category IMO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-869</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Sun, 08 Mar 2009 10:05:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-869</guid>
		<description>Couldn&#039;t agree more with Sascha.
&quot;this&quot; everywhere reminds me of people moving their lips when reading a newspaper. ;)
How can typing more make code cleaner? If you need &quot;this&quot; to distinguish between this and that your class maybe suffers from feature envy.

But it&#039;s funny, few things stir up a debate as heated as when it comes to coding conventions and which is the best editor.

Cheers, Dan</description>
		<content:encoded><![CDATA[<p>Couldn&#8217;t agree more with Sascha.<br />
&#8220;this&#8221; everywhere reminds me of people moving their lips when reading a newspaper. <img src='http://blog.hexagonstar.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
How can typing more make code cleaner? If you need &#8220;this&#8221; to distinguish between this and that your class maybe suffers from feature envy.</p>
<p>But it&#8217;s funny, few things stir up a debate as heated as when it comes to coding conventions and which is the best editor.</p>
<p>Cheers, Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Tynjala</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-868</link>
		<dc:creator>Josh Tynjala</dc:creator>
		<pubDate>Fri, 27 Feb 2009 02:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-868</guid>
		<description>sascha, those statements are not contradictory. Let me rearrange my thoughts to explain: When my code is more readable, then I&#039;m not spending more time trying to understand it again, and I can get the problem solved faster. I believe &quot;this&quot; makes my code more readable, so I believe that I get my problems solved faster.

I&#039;ve noted that you use underscores to do the same task that I use &quot;this&quot;. What makes your approach better? Underscores are an optional style choice (that is often frowned upon in other languages, I might add), but the &quot;this&quot; keyword is a construct available as part of the language itself. It sounds to me like you are reinventing the wheel by using underscores. Bad practice, indeed.

Let me finish my argument by noting that I can make the same argument as you. The use of underscores is not necessary. Clearly then, the only acceptable approach is to ensure that no variables that may accessible in the same function without a qualifier should share the same name.

I don&#039;t want to do that, and I don&#039;t think you do either. :)</description>
		<content:encoded><![CDATA[<p>sascha, those statements are not contradictory. Let me rearrange my thoughts to explain: When my code is more readable, then I&#8217;m not spending more time trying to understand it again, and I can get the problem solved faster. I believe &#8220;this&#8221; makes my code more readable, so I believe that I get my problems solved faster.</p>
<p>I&#8217;ve noted that you use underscores to do the same task that I use &#8220;this&#8221;. What makes your approach better? Underscores are an optional style choice (that is often frowned upon in other languages, I might add), but the &#8220;this&#8221; keyword is a construct available as part of the language itself. It sounds to me like you are reinventing the wheel by using underscores. Bad practice, indeed.</p>
<p>Let me finish my argument by noting that I can make the same argument as you. The use of underscores is not necessary. Clearly then, the only acceptable approach is to ensure that no variables that may accessible in the same function without a qualifier should share the same name.</p>
<p>I don&#8217;t want to do that, and I don&#8217;t think you do either. <img src='http://blog.hexagonstar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sascha</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-867</link>
		<dc:creator>sascha</dc:creator>
		<pubDate>Thu, 26 Feb 2009 13:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-867</guid>
		<description>Josh wrote:

&quot;Using this everywhere makes code way more readable for me&quot;

and:

&quot;I want to keep my mind on getting the problem done, not trying to understand my code.&quot;

A little contradictory aren&#039;t we?!


Note: &#039;this&#039; is not only not necessary, it is bad practice! ;)</description>
		<content:encoded><![CDATA[<p>Josh wrote:</p>
<p>&#8220;Using this everywhere makes code way more readable for me&#8221;</p>
<p>and:</p>
<p>&#8220;I want to keep my mind on getting the problem done, not trying to understand my code.&#8221;</p>
<p>A little contradictory aren&#8217;t we?!</p>
<p>Note: &#8216;this&#8217; is not only not necessary, it is bad practice! <img src='http://blog.hexagonstar.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ihsan</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-866</link>
		<dc:creator>Ihsan</dc:creator>
		<pubDate>Thu, 26 Feb 2009 08:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-866</guid>
		<description>Dear Josh,
In Turkish we have a proverb which says &quot;every brave warrior has his own way of eating yoghurt&quot; in summary :).</description>
		<content:encoded><![CDATA[<p>Dear Josh,<br />
In Turkish we have a proverb which says &#8220;every brave warrior has his own way of eating yoghurt&#8221; in summary <img src='http://blog.hexagonstar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Tynjala</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-865</link>
		<dc:creator>Josh Tynjala</dc:creator>
		<pubDate>Wed, 25 Feb 2009 18:11:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-865</guid>
		<description>You can take my this keyword away from my cold dead hands, my friend. I&#039;m not a newcomer either. I&#039;ve been writing code in various languages since 2000 and doing it in several versions of Flash since 2004. Using this everywhere makes code way more readable for me. I know instantly the scope where everything is located. If I come back to a class I haven&#039;t touched in a week or a month, I don&#039;t have to think to myself (even for the nanosecond it takes), &quot;is that a local variable, or is it a class member?&quot; Underscoring only differentiates some of the members, and the only benefit I use it for is to know when something is a private variable. In addition to instantly knowing the scope, using this for code hinting gets my code onto the screen faster. Sure, I could hit ctrl-space in most editors to bring it up, but why do that for one special case when I only need the dot for everything else? In short, skipping this would only slow me down and make it harder to do my job. I don&#039;t care if it&#039;s &quot;not necessary&quot;. I want to keep my mind on getting the problem done, not trying to understand my code.</description>
		<content:encoded><![CDATA[<p>You can take my this keyword away from my cold dead hands, my friend. I&#8217;m not a newcomer either. I&#8217;ve been writing code in various languages since 2000 and doing it in several versions of Flash since 2004. Using this everywhere makes code way more readable for me. I know instantly the scope where everything is located. If I come back to a class I haven&#8217;t touched in a week or a month, I don&#8217;t have to think to myself (even for the nanosecond it takes), &#8220;is that a local variable, or is it a class member?&#8221; Underscoring only differentiates some of the members, and the only benefit I use it for is to know when something is a private variable. In addition to instantly knowing the scope, using this for code hinting gets my code onto the screen faster. Sure, I could hit ctrl-space in most editors to bring it up, but why do that for one special case when I only need the dot for everything else? In short, skipping this would only slow me down and make it harder to do my job. I don&#8217;t care if it&#8217;s &#8220;not necessary&#8221;. I want to keep my mind on getting the problem done, not trying to understand my code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jos Koomen</title>
		<link>http://blog.hexagonstar.com/the-confusion-about-this/#comment-864</link>
		<dc:creator>Jos Koomen</dc:creator>
		<pubDate>Mon, 05 Jan 2009 11:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hexagonstar.com/?p=654#comment-864</guid>
		<description>Totally agree! We have made our code standards also to use this. But i&#039;m the only one who&#039;s doing it without wanting it.
It makes stuff less readable, and besides that it&#039;s anoying!</description>
		<content:encoded><![CDATA[<p>Totally agree! We have made our code standards also to use this. But i&#8217;m the only one who&#8217;s doing it without wanting it.<br />
It makes stuff less readable, and besides that it&#8217;s anoying!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

