<?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: Final Modifier for method arguments. What do you think?</title>
	<atom:link href="http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/</link>
	<description>Ganesh\</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:45:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: wolanlw</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-80313</link>
		<dc:creator>wolanlw</dc:creator>
		<pubDate>Tue, 07 Sep 2010 02:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-80313</guid>
		<description>Cookie theme wedding favour is&lt;a&gt;prom dresses&lt;/a&gt; the second option available for a &lt;a&gt;cheap prom dresses&lt;/a&gt;bridal couple to look for their guests.&lt;a&gt;wedding invites&lt;/a&gt; Most couples want something that represents&lt;a&gt;junior bridesmaid dresses&lt;/a&gt; their wedding day and at the same,&lt;a&gt;wedding hairstyles&lt;/a&gt; used as a nice token of their appreciation for the love and support of their wedding guests.&lt;a&gt;celebrity lace front wigs&lt;/a&gt; Opting custom wedding cookie favors is a good choice for the wedding couple.&lt;a&gt;wedding invitations&lt;/a&gt; The cookies can add nice décor to the wedding reception and the delicious treat well be appreciated by the wedding guests</description>
		<content:encoded><![CDATA[<p>Cookie theme wedding favour is<a>prom dresses</a> the second option available for a <a>cheap prom dresses</a>bridal couple to look for their guests.<a>wedding invites</a> Most couples want something that represents<a>junior bridesmaid dresses</a> their wedding day and at the same,<a>wedding hairstyles</a> used as a nice token of their appreciation for the love and support of their wedding guests.<a>celebrity lace front wigs</a> Opting custom wedding cookie favors is a good choice for the wedding couple.<a>wedding invitations</a> The cookies can add nice décor to the wedding reception and the delicious treat well be appreciated by the wedding guests</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: travesti</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-71112</link>
		<dc:creator>travesti</dc:creator>
		<pubDate>Sun, 25 Apr 2010 10:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-71112</guid>
		<description>Consequently when the method returns, the caller can investigate the passed List and work with the modifications the callee introduced.</description>
		<content:encoded><![CDATA[<p>Consequently when the method returns, the caller can investigate the passed List and work with the modifications the callee introduced.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: non const</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-69740</link>
		<dc:creator>non const</dc:creator>
		<pubDate>Thu, 18 Mar 2010 20:44:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-69740</guid>
		<description>[...] action, Warning, warning, the const decoration is dropped..., the same reason lies in the bool ...Final Modifier for method arguments. What do you think? &#124; GaneshThe IT industry today is sodden with TLAs like SOA, ESB... and FLAs like AJAX, SOAP and JUNK. i was [...]</description>
		<content:encoded><![CDATA[<p>[...] action, Warning, warning, the const decoration is dropped&#8230;, the same reason lies in the bool &#8230;Final Modifier for method arguments. What do you think? | GaneshThe IT industry today is sodden with TLAs like SOA, ESB&#8230; and FLAs like AJAX, SOAP and JUNK. i was [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: travmik</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-69730</link>
		<dc:creator>travmik</dc:creator>
		<pubDate>Thu, 18 Mar 2010 12:54:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-69730</guid>
		<description>So guys. 
Vinod get us example and Ganeshji Marwaha says that it is good code, but lets look at the code.

private static void badtamper(final ArrayList l) {
ArrayList nl = new ArrayList();
nl.add(”One”);
nl.add(”Two”);
nl.add(”Three”);
l = nl; - THIS IS COMPILATION TIME ERROR - you can&#039;t change reference if it is final, but you can change data in object
System.out.println(”In bad callee value :” + l);
}

Ok i can change some things:

public static void main(String[] args) {
ArrayList l = new ArrayList();
l.add(”1?);
l.add(”2?);
l.add(”3?);
System.out.println(”Original List ” + l);
badtamper(l);
System.out.println(”In caller value after bad callee:” + l);
tamperlist(l);
System.out.println(”In caller value :” + l);
}

private static void badtamper(final ArrayList l) {
l.remove(2);
l.add(2, “bad”);
System.out.println(”In bad callee value :” + l);
}

private static void tamperlist(ArrayList&gt; l) {
l.remove(2);
l.add(2, “not bad”);
System.out.println(”In callee value :” + l);
}

Now when the code is run the following gets printed out :
Original List [1, 2, 3]
In bad callee value :[1, 2, bad]
In caller value after bad callee:[1, 2, bad]
In callee value :[1, 2, not bad]
In caller value :[1, 2, not bad]

Actually no difference. ;)</description>
		<content:encoded><![CDATA[<p>So guys.<br />
Vinod get us example and Ganeshji Marwaha says that it is good code, but lets look at the code.</p>
<p>private static void badtamper(final ArrayList l) {<br />
ArrayList nl = new ArrayList();<br />
nl.add(”One”);<br />
nl.add(”Two”);<br />
nl.add(”Three”);<br />
l = nl; &#8211; THIS IS COMPILATION TIME ERROR &#8211; you can&#8217;t change reference if it is final, but you can change data in object<br />
System.out.println(”In bad callee value :” + l);<br />
}</p>
<p>Ok i can change some things:</p>
<p>public static void main(String[] args) {<br />
ArrayList l = new ArrayList();<br />
l.add(”1?);<br />
l.add(”2?);<br />
l.add(”3?);<br />
System.out.println(”Original List ” + l);<br />
badtamper(l);<br />
System.out.println(”In caller value after bad callee:” + l);<br />
tamperlist(l);<br />
System.out.println(”In caller value :” + l);<br />
}</p>
<p>private static void badtamper(final ArrayList l) {<br />
l.remove(2);<br />
l.add(2, “bad”);<br />
System.out.println(”In bad callee value :” + l);<br />
}</p>
<p>private static void tamperlist(ArrayList&gt; l) {<br />
l.remove(2);<br />
l.add(2, “not bad”);<br />
System.out.println(”In callee value :” + l);<br />
}</p>
<p>Now when the code is run the following gets printed out :<br />
Original List [1, 2, 3]<br />
In bad callee value :[1, 2, bad]<br />
In caller value after bad callee:[1, 2, bad]<br />
In callee value :[1, 2, not bad]<br />
In caller value :[1, 2, not bad]</p>
<p>Actually no difference. <img src='http://www.gmarwaha.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-69371</link>
		<dc:creator>Jimmy</dc:creator>
		<pubDate>Tue, 09 Mar 2010 18:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-69371</guid>
		<description>l = nl;

Using final to clutter up your code in an attempt to prevent lines like this is pure rubbish. If you are working for/with developers who make such rudimentary mistakes such as this I suggest you fire them or switch jobs.

If you really need a compiler to prevent you from making such mistakes you really have much bigger problems than finals. It&#039;s absolutely pointless in java</description>
		<content:encoded><![CDATA[<p>l = nl;</p>
<p>Using final to clutter up your code in an attempt to prevent lines like this is pure rubbish. If you are working for/with developers who make such rudimentary mistakes such as this I suggest you fire them or switch jobs.</p>
<p>If you really need a compiler to prevent you from making such mistakes you really have much bigger problems than finals. It&#8217;s absolutely pointless in java</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Jablow</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-68932</link>
		<dc:creator>Eric Jablow</dc:creator>
		<pubDate>Sun, 28 Feb 2010 05:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-68932</guid>
		<description>Final parameters and local variables can be used in inner classes.  Non-final parameters and local variables cannot.  Whether this is good or bad is arguable.</description>
		<content:encoded><![CDATA[<p>Final parameters and local variables can be used in inner classes.  Non-final parameters and local variables cannot.  Whether this is good or bad is arguable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Holser</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-68817</link>
		<dc:creator>Paul Holser</dc:creator>
		<pubDate>Thu, 25 Feb 2010 23:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-68817</guid>
		<description>I prefer to omit &#039;final&#039; from method arguments, and use tools like Checkstyle to enforce rules such as not changing what method arguments refer to.  Too much syntactic noise for my taste.</description>
		<content:encoded><![CDATA[<p>I prefer to omit &#8216;final&#8217; from method arguments, and use tools like Checkstyle to enforce rules such as not changing what method arguments refer to.  Too much syntactic noise for my taste.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sjoerd Talsma</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-68798</link>
		<dc:creator>Sjoerd Talsma</dc:creator>
		<pubDate>Thu, 25 Feb 2010 16:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-68798</guid>
		<description>I fully agree with Peter Veentjer, with the addition that I think the lack of named parameters in Java is totally unrelated but similar problem.</description>
		<content:encoded><![CDATA[<p>I fully agree with Peter Veentjer, with the addition that I think the lack of named parameters in Java is totally unrelated but similar problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Code Goop</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-68790</link>
		<dc:creator>Code Goop</dc:creator>
		<pubDate>Thu, 25 Feb 2010 12:50:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-68790</guid>
		<description>&lt;strong&gt;Input params are not for output...&lt;/strong&gt;

Sometimes you run across some code that makes you cringe a little bit. That happened to me today when I ran across this blog post. It&#8217;s about how the final modifier is used for method parameters. A sample of what the post is trying to convey look...</description>
		<content:encoded><![CDATA[<p><strong>Input params are not for output&#8230;</strong></p>
<p>Sometimes you run across some code that makes you cringe a little bit. That happened to me today when I ran across this blog post. It&#8217;s about how the final modifier is used for method parameters. A sample of what the post is trying to convey look&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willi</title>
		<link>http://www.gmarwaha.com/blog/2010/01/02/final-modifier-for-method-arguments-what-do-you-think/comment-page-1/#comment-68787</link>
		<dc:creator>Willi</dc:creator>
		<pubDate>Thu, 25 Feb 2010 12:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gmarwaha.com/blog/?p=138#comment-68787</guid>
		<description>Good job man..</description>
		<content:encoded><![CDATA[<p>Good job man..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
