<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>stacyprowell.com &#187; Java</title>
	<atom:link href="http://stacyprowell.com/blog/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://stacyprowell.com/blog</link>
	<description>Ugh, Stacy's talking again...</description>
	<lastBuildDate>Tue, 27 Apr 2010 20:09:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>And Another Thing That Bugs Me About Java&#8230;</title>
		<link>http://stacyprowell.com/blog/2009/09/30/and-another-thing-that-bugs-me-about-java/</link>
		<comments>http://stacyprowell.com/blog/2009/09/30/and-another-thing-that-bugs-me-about-java/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 03:05:15 +0000</pubDate>
		<dc:creator>stacy</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Nuisances]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[const]]></category>
		<category><![CDATA[immutable]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=415</guid>
		<description><![CDATA[Just a short note on an item that bugs me about Java.  In C++, I tend to use exactly three kinds of method parameters.

A const reference.  I don&#8217;t want to copy it, but I promise not to modify it, either.
A reference.  I might modify it.
A copy.  I might modify my local copy, but not the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-116" title="java_logo_2" src="http://stacyprowell.com/blog/wp-content/uploads/2008/07/java_logo_2-150x150.png" alt="java_logo_2" width="120" height="120" />Just a short note on an item that bugs me about Java.  In C++, I tend to use exactly three kinds of method parameters.</p>
<ul>
<li>A const reference.  I don&#8217;t want to copy it, but I promise not to modify it, either.</li>
<li>A reference.  I might modify it.</li>
<li>A copy.  I might modify my local copy, but not the original.  I&#8217;m getting a copy, after all.</li>
</ul>
<p>Easy peasy in C++.  In Java?  Uh, I pass all objects by reference.<span id="more-415"></span> The interface says nothing about modification.  Pass me a Map and maybe I&#8217;ll modify it, maybe not.  You don&#8217;t know, and you can&#8217;t enforce it.  Unless you pass me a Collections.unmodifiableMap().  Then my code might break!  There might be some odd little case left over where I do modify it, in spite of documentation comments to the contrary.  C++?  I declare it to be a const reference, and now the compiler will prevent me from modifying it.  I like that quite a bit.</p>
<p>I also like const methods, and you really can&#8217;t have const without const methods.  The Java way it to throw exceptions.  I&#8217;d rather have the compiler tell me something at compile-time than have the runtime system fail at runtime.  But I&#8217;m weird, I suppose.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fstacyprowell.com%2Fblog%2F2009%2F09%2F30%2Fand-another-thing-that-bugs-me-about-java%2F&amp;linkname=And%20Another%20Thing%20That%20Bugs%20Me%20About%20Java%26%238230%3B"><img src="http://stacyprowell.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://stacyprowell.com/blog/2009/09/30/and-another-thing-that-bugs-me-about-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suffering in Java</title>
		<link>http://stacyprowell.com/blog/2008/07/09/suffering-in-java/</link>
		<comments>http://stacyprowell.com/blog/2008/07/09/suffering-in-java/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 18:33:48 +0000</pubDate>
		<dc:creator>stacy</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Nuisances]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://stacyprowell.com/blog/?p=5</guid>
		<description><![CDATA[I like Java.  Well, that is, I don&#8217;t dislike Java as much as I dislike most other langauges.  I&#8217;d honestly prefer ML, but I&#8217;d be without the massive ball of mud that is the Java class libraries, the wonder that is Eclipse, and ANTLR.  I need these.  It&#8217;s a weakness.
(I know there is ML support [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-116 alignright" title="java_logo_2" src="http://stacyprowell.com/blog/wp-content/uploads/2008/07/java_logo_2.png" alt="java_logo_2" width="90" height="119" />I <em>like</em> Java.  Well, that is, I don&#8217;t <em>dis</em>like Java as much as I dislike most other langauges.  I&#8217;d honestly prefer ML, but I&#8217;d be without the massive ball of mud that is the Java class libraries, the wonder that is Eclipse, and ANTLR.  I <em>need</em> these.  It&#8217;s a weakness.<span id="more-5"></span></p>
<p>(I know there is ML support for Eclipse, but it&#8217;s nowhere near Java support.)</p>
<p>All that said, I complain about Java a <em>lot</em>.  Almost as much as I <em>mis</em>use <em>italics</em>.  Anyway, here is my list of peeves in the current Java, in no particular order.</p>
<ul>
<li>Lack of reified generics.</li>
</ul>
<p>I&#8217;ve written my fair share of C++.  I&#8217;m used to the idea that when you instantiate a template you get a class.  That&#8217;s not how Java works.  The whole type erasure idea makes me crazy almost every day.  I&#8217;d be okay if the type information was available at runtime, but of course it isn&#8217;t.  I&#8217;m not the only one bothered by this.</p>
<ul>
<li>Lack of closures.</li>
</ul>
<p>Did I mention that I like ML?  Haskell?  Lisp?  I understand closures, and I want to use them.  I don&#8217;t want a watered down version like with generics.  I want real closures.  Everyone doesn&#8217;t have to use them; they aren&#8217;t an idiom for idiots.  I can make do without them, but why should I have to?</p>
<ul>
<li>Lack of macros.</li>
</ul>
<p>It&#8217;s not politic to miss #define, but I do.  There are lots of places where I would just love to use a compile-time macro.  Recently we had a problem on a project of lots of strings getting created because of debugging statements (log4j) that were <em>not</em> enabled.  Doesn&#8217;t matter; the string gets created.  The compiler can&#8217;t optimize it out, since debugging can be enabled at runtime, and I get that.  But do I really need that most of the time?</p>
<p>Also, I use certain design patterns that cry out for a macro.  Want a factory?  Most of it is boilerplate.  Could I do this with the new annotation system?  Probably, but&#8230; you can&#8217;t replace a class with an apt-generated class; you can only generate new classes.</p>
<ul>
<li>Lack of delegates.</li>
</ul>
<p>This would probably not be an issue if we had closures.  However delegates are easily understood, and very useful.</p>
<p>Okay, that&#8217;s my Java rant for today.  Back to writing Java&#8230;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fstacyprowell.com%2Fblog%2F2008%2F07%2F09%2Fsuffering-in-java%2F&amp;linkname=Suffering%20in%20Java"><img src="http://stacyprowell.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://stacyprowell.com/blog/2008/07/09/suffering-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
