<?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: My dislike of Java&#8217;s static import</title>
	<atom:link href="http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-481</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Fri, 26 Sep 2008 05:34:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-481</guid>
		<description>Just remembered the other reason we had a problem with it - we were using eclipse&#039;s Ivy plugin and quite frequently it wouldn&#039;t resolve dependencies correctly.

I think eclipse was setup to automatically clean up the imports on files or something like that so whenever the Ivy resolution failed all the import statics were being removed and we had problems trying to work out where they had come from in the first place.

Can&#039;t blame that all on import static of course but it was an additional problem we could have done without!</description>
		<content:encoded><![CDATA[<p>Just remembered the other reason we had a problem with it &#8211; we were using eclipse&#8217;s Ivy plugin and quite frequently it wouldn&#8217;t resolve dependencies correctly.</p>
<p>I think eclipse was setup to automatically clean up the imports on files or something like that so whenever the Ivy resolution failed all the import statics were being removed and we had problems trying to work out where they had come from in the first place.</p>
<p>Can&#8217;t blame that all on import static of course but it was an additional problem we could have done without!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Easily misused language features at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-476</link>
		<dc:creator>Easily misused language features at Mark Needham</dc:creator>
		<pubDate>Thu, 25 Sep 2008 22:18:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-476</guid>
		<description>[...] the comments of my previous post about my bad experiences with Java&#039;s import static my colleague Carlos and several others pointed out that it is actually a useful feature when used [...]</description>
		<content:encoded><![CDATA[<p>[...] the comments of my previous post about my bad experiences with Java&#8217;s import static my colleague Carlos and several others pointed out that it is actually a useful feature when used [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-472</link>
		<dc:creator>Nate</dc:creator>
		<pubDate>Thu, 25 Sep 2008 16:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-472</guid>
		<description>&quot;I want to be able to tell what is going on in the code from looking at it and anything which prevents this is a hindrance.&quot;

I agree.  That is the benefit of static imports.  Specifically, I want the max of 1 and 2.  How do I find this out?  max(1,2).  Sweet.  I have very little need to know that this comes from java.lang.Math, and so putting Math.max(1,2) introduces noise.  Much like you (hopefully) wouldn&#039;t put java.lang.Math.max(1,2).

The rule is simple (and somewhat subjective... if you aren&#039;t sure, just ask me what I prefer. :) ) -- if it helps the code to communicate better (especially contextually!) then use it.</description>
		<content:encoded><![CDATA[<p>&#8220;I want to be able to tell what is going on in the code from looking at it and anything which prevents this is a hindrance.&#8221;</p>
<p>I agree.  That is the benefit of static imports.  Specifically, I want the max of 1 and 2.  How do I find this out?  max(1,2).  Sweet.  I have very little need to know that this comes from java.lang.Math, and so putting Math.max(1,2) introduces noise.  Much like you (hopefully) wouldn&#8217;t put java.lang.Math.max(1,2).</p>
<p>The rule is simple (and somewhat subjective&#8230; if you aren&#8217;t sure, just ask me what I prefer. <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) &#8212; if it helps the code to communicate better (especially contextually!) then use it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-469</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Thu, 25 Sep 2008 12:34:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-469</guid>
		<description>Maybe my dislike is more around the misuse of them as you guys all mention - the code base I saw them used in was gathering static imports from across four different classes into one place so it wasn&#039;t obvious at all where the original definitions of them was.

I can certainly see some cases where they would be useful in making the code more readable but I&#039;m not convinced for example of the benefit of statically importing say junit assertions so you can do assertEquals rather than Assert.assertEquals for example but that&#039;s just me :)

Regarding the power of some features in programming languages I agree there are some features which can be severely misused. Sometimes I wonder whether the benefits are worth the potential misuse.</description>
		<content:encoded><![CDATA[<p>Maybe my dislike is more around the misuse of them as you guys all mention &#8211; the code base I saw them used in was gathering static imports from across four different classes into one place so it wasn&#8217;t obvious at all where the original definitions of them was.</p>
<p>I can certainly see some cases where they would be useful in making the code more readable but I&#8217;m not convinced for example of the benefit of statically importing say junit assertions so you can do assertEquals rather than Assert.assertEquals for example but that&#8217;s just me <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regarding the power of some features in programming languages I agree there are some features which can be severely misused. Sometimes I wonder whether the benefits are worth the potential misuse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos Villela</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-467</link>
		<dc:creator>Carlos Villela</dc:creator>
		<pubDate>Thu, 25 Sep 2008 12:06:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-467</guid>
		<description>Mark, static imports are just another small (and enabling!) feature - when it comes to trying to figure out where code is coming from, especially in Java, where IDEs are incredibly powerful, hovering the mouse pointer over or ctrl-clicking the method call should take care of things.

Speaking of Java 5 features, I&#039;d be more worried about the misuses of generics and the copious amount of needless warnings it generates - so many, in fact, there are annotations to stop them from appearing :)</description>
		<content:encoded><![CDATA[<p>Mark, static imports are just another small (and enabling!) feature &#8211; when it comes to trying to figure out where code is coming from, especially in Java, where IDEs are incredibly powerful, hovering the mouse pointer over or ctrl-clicking the method call should take care of things.</p>
<p>Speaking of Java 5 features, I&#8217;d be more worried about the misuses of generics and the copious amount of needless warnings it generates &#8211; so many, in fact, there are annotations to stop them from appearing <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Marti</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-465</link>
		<dc:creator>Thomas Marti</dc:creator>
		<pubDate>Thu, 25 Sep 2008 10:06:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-465</guid>
		<description>I concur with Diego. Also, quite a few libraries would be practically useless without that feature.

http://code.google.com/p/hamcrest/ 
http://functionaljava.org/
and others...</description>
		<content:encoded><![CDATA[<p>I concur with Diego. Also, quite a few libraries would be practically useless without that feature.</p>
<p><a href="http://code.google.com/p/hamcrest/" rel="nofollow">http://code.google.com/p/hamcrest/</a><br />
<a href="http://functionaljava.org/" rel="nofollow">http://functionaljava.org/</a><br />
and others&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego Carrion</title>
		<link>http://www.markhneedham.com/blog/2008/09/24/my-dislike-of-javas-static-import/comment-page-1/#comment-460</link>
		<dc:creator>Diego Carrion</dc:creator>
		<pubDate>Thu, 25 Sep 2008 02:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=378#comment-460</guid>
		<description>In that case you should maybe dislike programming languages because with any of them I can do horrible things.

I think you should blame developers that use static imports in the wrong way, not the static imports itself.

Static imports rocks when youre creating internal DSLs.

A great power comes with a big responsibility :)</description>
		<content:encoded><![CDATA[<p>In that case you should maybe dislike programming languages because with any of them I can do horrible things.</p>
<p>I think you should blame developers that use static imports in the wrong way, not the static imports itself.</p>
<p>Static imports rocks when youre creating internal DSLs.</p>
<p>A great power comes with a big responsibility <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

