<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Matt Stine&#039;s Blog &#187; loty</title>
	<atom:link href="http://mattstine.com/category/loty/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattstine.com</link>
	<description>Thoughts on Java, Groovy, Grails, Agile Development, etc. etc. etc.</description>
	<lastBuildDate>Tue, 17 May 2011 17:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mattstine.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Stine&#039;s Blog &#187; loty</title>
		<link>http://mattstine.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mattstine.com/osd.xml" title="Matt Stine&#039;s Blog" />
	<atom:link rel='hub' href='http://mattstine.com/?pushpress=hub'/>
		<item>
		<title>LOTY/TOTY for 2010</title>
		<link>http://mattstine.com/2010/01/06/lotytoty-for-2010/</link>
		<comments>http://mattstine.com/2010/01/06/lotytoty-for-2010/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 19:25:09 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[loty]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/2010/01/06/lotytoty-for-2010/</guid>
		<description><![CDATA[If anyone&#8217;s interested, here&#8217;s a clue as to what I&#8217;m working on in 2010:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=284&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If anyone&#8217;s interested, here&#8217;s a clue as to what I&#8217;m working on in 2010:</p>
<p><img src="http://mattstine.files.wordpress.com/2010/05/helloiphone.jpg?w=570" alt="" title=""   class="aligncenter size-full wp-image-338" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=284&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2010/01/06/lotytoty-for-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>

		<media:content url="http://mattstine.files.wordpress.com/2010/05/helloiphone.jpg" medium="image" />
	</item>
		<item>
		<title>Making Java &#8220;Groovier&#8221; with LambdaJ</title>
		<link>http://mattstine.com/2009/10/09/making-java-groovier-with-lambdaj/</link>
		<comments>http://mattstine.com/2009/10/09/making-java-groovier-with-lambdaj/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 14:37:06 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[functional-programming]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[loty]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=257</guid>
		<description><![CDATA[I spent the better part of yesterday tracing my way through the codebase for a large-scale enterprise application that my team is building right now, and I happened upon the following piece of code: As I read this code, I thought &#8220;This just SCREAMS a need for Groovy&#8217;s closure iterators.&#8221; So, last night I quickly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=257&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I spent the better part of yesterday tracing my way through the codebase for a large-scale enterprise application that my team is building right now, and I happened upon the following piece of code:</p>
<p><pre class="brush: java;">
//...imports excluded for clarity
public class BusinessActivityBinMetaClassHelper {
//...
   public static List&lt;Long&gt; getSrmMetaClassIdListJava(List&lt;BusinessActivityBinMetaClass&gt; businessActivityBinMetaClassList) {
      List&lt;Long&gt; srmMetaClassIdList = new ArrayList&lt;Long?();

      if(businessActivityBinMetaClassList != null) {
         for(BusinessActivityBinMetaClass businessActivityBinMetaClass : businessActivityBinMetaClassList) {
             if(businessActivityBinMetaClass.getSrmMetaClass() != null &amp;&amp; businessActivityBinMetaClass.getSrmMetaClass().getSrmMetaClassId() != null) {
               srmMetaClassIdList.add
                  (businessActivityBinMetaClass.getSrmMetaClass().getSrmMetaClassId());
            }
         }
      }

      return srmMetaClassIdList;
   }
//...
}
</pre></p>
<p>As I read this code, I thought &#8220;This just SCREAMS a need for Groovy&#8217;s closure iterators.&#8221; So, last night I quickly hacked out fully-equivalent Groovy version of the code:</p>
<p><pre class="brush: groovy;">
class GroovyExample {

   static def getSrmMetaClassIdListGroovy(def businessActivityBinMetaClassList) {
      businessActivityBinMetaClassList?.collect { it?.srmMetaClass?.srmMetaClassId }.findAll { it != null } ?: new ArrayList&lt;Long&gt;();
   }
}
</pre></p>
<p>Whew! Much nicer. What did we get out of this? Well&#8230;</p>
<ul>
<li>Groovy&#8217;s dynamic typing cleaned up all of the unnecessary type declarations &#8211; the only static typing is where we return an empty ArrayList of Longs if the argument to our method is null (a bit of odd behavior, but required to make this code equivalent to the parent Java code.</li>
<li>We were saved 4 painful null checks by the use of Groovy&#8217;s null safe dereferencing operator (?.) and the simplified ternary operator otherwise affectionately known as the &#8220;Elvis Operator&#8221; (?:).</li>
<li>Using Groovy&#8217;s collect method, we were able to transform the original list into a list containing Long values by passing in a closure that pulls out the property value of interest.</li>
<li>Because we&#8217;re using null safe dereferencing, we are actually inserting nulls into our list if any of the dereferencing fails. Therefore, Groovy&#8217;s findAll Collection filtering method comes to the rescue. We simply provide it with a closure that returns true for all of the values we want to keep &#8211; in this case, &#8220;it != null.&#8221;</li>
<li>Perhaps most importantly, we&#8217;ve shorted our code from 11 lines (including whitespace lines for clarity) to ONE LINE that much more clearly expresses the intent of the code.</li>
</ul>
<p>Great &#8211; why don&#8217;t we just rewrite the entire application is Groovy? Well, hold on just a minute. At the time we started this application, as much as some of us loved Groovy, we just didn&#8217;t have enough Groovy mindshare to go there yet. On top of that, we were already experimenting with several new architectural ideas and technologies, and Groovy would have added yet one more risk to the puzzle. I say all this to acknowledge that sometimes you just can&#8217;t move to another language for one reason or another, regardless of how attractive its features may be.</p>
<p>But let&#8217;s take a queue from the <em>Pragmatic Programmer</em> and explore the LOTY (Language of the Year) concept one more time. One of the reasons that you&#8217;re encouraged to learn new languages is to change the way you program in your main language. You may learn Groovy, Scala, Clojure, Ruby, etc., etc., etc. and never use them in your day job &#8211; and yet the experience of coding in a new language with new constructs and idioms will necessarily change the way you THINK about programming in every other language.</p>
<p>So, let&#8217;s think about the possibility of coding something that is much more similar to the Groovy version and yet stick with regular Java code. Fortunately, there are several libraries out there that bring much of the flavor and power of Groovy&#8217;s closure iterators to Java. I&#8217;d like to focus in on one of them, LambdaJ (<a href="http://code.google.com/p/lambdaj/">http://code.google.com/p/lambdaj/</a>).</p>
<p>LambdaJ provides constructs that allow us to &#8220;&#8230;manipulate collections in a pseudo-functional and statically typed way.&#8221; Let&#8217;s take a look at this example implementing using LambdaJ:</p>
<p><pre class="brush: java;">
//...some imports excluded for clarity
import ch.lambdaj.function.convert.Converter
import static ch.lambdaj.Lambda.*
import static org.hamcrest.Matchers.*

public class BusinessActivityBinMetaClassHelper {
//...
   public static List&lt;Long&gt; getSrmMetaClassIdListJava(List&lt;BusinessActivityBinMetaClass&gt; businessActivityBinMetaClassList) {
      return (businessActivityBinMetaClassList != null) ? filter(notNullValue(),convert(businessActivityBinMetaClassList, new IdExtractor())) : new ArrayList&lt;Long&gt;();
   }

   class IdExtractor implements Converter&lt;BusinessActivityBinMetaClass,Long&gt; {
	Long convert(BusinessActivityBinMetaClass from) {
	   if (from.getSrmMetaClass() != null &amp;&amp; from.getSrmMetaClass().getSrmMetaClassId() != null) {
	      return from.getSrmMetaClass().getSrmMetaClassId();
	   }
   }
}
</pre></p>
<p>Not quite as nice as the Groovy code &#8211; we got A LOT out of the null-safe dereference and Elvis operators. However, our overall intent is still a bit clearer. Let&#8217;s analyze:</p>
<ul>
<li>First we need to implement one of LambdaJ&#8217;s Converters. A Converter is nothing more than a generic Interface that defines one method: T convert(F from), where F is the type we&#8217;re converting from and T is the type we&#8217;re converting to. In this case, we want to convert an object of type BusinessActivityBinMetaClass to an object of type Long. Our implementation determines how this conversion takes place, in this case by extracting the id property from its child.</li>
<li>Next, after statically importing the methods of ch.lambdaj.Lambda, we call the convert method, passing it our List and our newly implemented Converter. This gives us the equivalent of Groovy&#8217;s collect method, with the Converter taking the place of the closure.</li>
<li>We&#8217;re still shoving nulls into our List with this implementation, so we further filter our list using LambdaJ&#8217;s &#8220;filter&#8221; method, passing it the list returned by &#8220;filter,&#8221; and a <a href="http://code.google.com/p/hamcrest/">Hamcrest</a> matcher that returns only notNullValue()&#8217;s.</li>
<li>Finally, we use our old friend the ternary operator to return the empty ArrayList of Long values if our method argument is null.</li>
</ul>
<p>If you don&#8217;t count the Converter implementation, we&#8217;ve gotten ourselves down to 2 lines of code (1 if you don&#8217;t mind long lines). In this case I implemented IdExtractor as a named inner class &#8211; you could do this with an anonymous inner class and it would look a lot more like a closure, but the added noise of all of the null checking made the undesirable for me. Perhaps if your code has less noise (or guarantees that values aren&#8217;t null), that would be a better approach.</p>
<p>Another alternative is to make IdExtractor a top-level class that, if general enough, could be reused throughout the codebase. The benefit of this is that you now have a nice code unit rather than a battery of static methods in a utility class, and unit testing becomes much more clean and elegant.</p>
<p>So, we&#8217;ve still made some progress and made our code a bit more Groovy. I encourage you to explore LambdaJ&#8217;s feature set and see how it might make your code a bit more concise with clearer intent. And just to stir up a little controversy, look what would have happened in Java 7 had the null safe dereference and Elvis operator&#8217;s made <a href="http://blogs.sun.com/darcy/entry/project_coin_final_five">the Project Coin cut</a>:</p>
<p><pre class="brush: java;">
//...some imports excluded for clarity
import ch.lambdaj.function.convert.Converter
import static ch.lambdaj.Lambda.*
import static org.hamcrest.Matchers.*

public class BusinessActivityBinMetaClassHelper {
//...
   public static List&lt;Long&gt; getSrmMetaClassIdListLambdaJ(List&lt;BusinessActivityBinMetaClass&gt; businessActivityBinMetaClassList) {
      return filter(notNullValue(),convert(businessActivityBinMetaClassList,
         new Converter&lt;BusinessActivityBinMetaClass,Long&gt; {
            Long apply(BusinessActivityBinMetaClass from) { return from?.getSrmMetaClass()?.getSrmMetaClassId()}
         })) ?: new ArrayList&lt;Long&gt;();
   }
}
</pre></p>
<p>Nice, huh? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=257&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2009/10/09/making-java-groovier-with-lambdaj/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
		<item>
		<title>Functional programming blog aggregator in the works&#8230;</title>
		<link>http://mattstine.com/2009/04/30/functional-programming-blog-aggregator-in-the-works/</link>
		<comments>http://mattstine.com/2009/04/30/functional-programming-blog-aggregator-in-the-works/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 18:31:58 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[functional-programming]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[loty]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[toty]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=155</guid>
		<description><![CDATA[So I&#8217;m in the midst of planning my next toy project, specifically with an aim to build something for the cloud, be it Google App Engine, Mor.ph, EC2, etc. (that part is still up for grabs). What I&#8217;d like to do is an opt-in blog aggregation site focused around functional programming. It would be very [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=155&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m in the midst of planning my next toy project, specifically with an aim to build something for the cloud, be it <a href="http://code.google.com/appengine">Google App Engine</a>, <a href="http://mor.ph">Mor.ph</a>, <a href="http://aws.amazon.com/ec2/">EC2</a>, etc. (that part is still up for grabs). What I&#8217;d like to do is an opt-in blog aggregation site focused around functional programming. It would be very similar to what <a href="http://blogs.bytecode.com.au/glen/">Glen Smith</a> has done with <a href="http://groovyblogs.org">groovyblogs.org</a>. Groovyblogs is currently my number one referral site and is generating about 20% of the traffic for this blog. I think it is a great way to find out what blogs are out there in a given space, and there doesn&#8217;t seem to be an equivalent for the functional space. Since my LOTY interest is focused in the functional space, particularly around Scala and Clojure, and my TOTY interest is the cloud technologies out there, it seems like the perfect marriage.</p>
<p>So here&#8217;s my question. Would you be interested in using such a site? As a reader, blogger, or both? Please sound off. Thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=155&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2009/04/30/functional-programming-blog-aggregator-in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello, Clojure!</title>
		<link>http://mattstine.com/2009/04/24/hello-clojure/</link>
		<comments>http://mattstine.com/2009/04/24/hello-clojure/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 22:12:23 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[loty]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/2009/04/24/hello-clojure/</guid>
		<description><![CDATA[; Hello World! (defn hello [name] (println "Hello, " name)) (hello "World!")<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=130&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain">
; Hello World!
(defn hello [name]
  (println "Hello, " name))

(hello "World!")
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=130&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2009/04/24/hello-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
		<item>
		<title>LOTY&#8230;Part Deux</title>
		<link>http://mattstine.com/2009/04/06/lotypart-deux/</link>
		<comments>http://mattstine.com/2009/04/06/lotypart-deux/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 03:31:58 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[dynamiclanguages]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[loty]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=117</guid>
		<description><![CDATA[A few days ago I pontificated on my need to choose a new &#8220;Language of the Year.&#8221; Right now I&#8217;m attempting to choose between Scala and Clojure. If nothing else, I&#8217;ve learned from this exercise that asking the community for feedback is a GOOD thing. Your comments have been very helpful. To summarize: As far [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=117&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-120" title="scala_vs_clojure" src="http://mattstine.files.wordpress.com/2009/04/scala_vs_clojure.jpg?w=570" alt="scala_vs_clojure"   style="float:left;margin-right:20px;" /><a href="http://mattstine.files.wordpress.com/2009/04/scala_vs_clojure.jpg2009/04/02/loty-time-again-scala-or-clojure">A few days ago I pontificated</a> on my need to choose a new &#8220;Language of the Year.&#8221; Right now I&#8217;m attempting to choose between <a href="http://www.scala-lang.org/">Scala</a> and <a href="http://clojure.org/">Clojure</a>. If nothing else, I&#8217;ve learned from this exercise that asking the community for feedback is a GOOD thing. Your comments have been very helpful.</p>
<p>To summarize:</p>
<ol>
<li>As far as the polls go, Scala is in the lead by a margin of 4 to 2.</li>
<li>Two of the Scala votes have been simple +1&#8242;s, and two have provided a supporting argument.</li>
<li>Both Clojure voters have provided a supporting argument.</li>
<li>So, to make this a bit more of a fair fight, I&#8217;m only going to consider the &#8220;supported votes&#8221; at this point. This leads to the obvious result of a tie!</li>
</ol>
<p>So, what to do?</p>
<p>The argument for using Scala is that it is a functional/OO hybrid, so it will be easier to slide into. Interestingly enough, the argument against using Scala is that it is a functional/OO hybrid, so it will be easier to slide back into OO/imperative habits! Clojure, being more of a purely functional language, will be harder to get into initially, but will force me to think functionally. Hmmm&#8230;</p>
<p>So here&#8217;s my idea. Let&#8217;s do this the agile way. What I&#8217;d like to do is complete a timeboxed spike (in terms of actual time spent learning the language, not calendar time &#8211; I&#8217;m doing this in my spare time, and I&#8217;ve got my wife, four kids, and three other side projects competing for my attention!) of roughly two weeks in each language. The first week of the spike would be spent getting comfortable with the syntax, reading articles/documentation/blogs/etc., writing &#8220;Hello, World!&#8221; etc. The second week of the spike would be spent solving the same problem in each language, preferably a problem sitting in the functional sweet spot.</p>
<p>How does this sound to everyone? And to follow up, does anyone have a suggested problem I might tackle? Cheers!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=117&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2009/04/06/lotypart-deux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>

		<media:content url="http://mattstine.files.wordpress.com/2009/04/scala_vs_clojure.jpg" medium="image">
			<media:title type="html">scala_vs_clojure</media:title>
		</media:content>
	</item>
	</channel>
</rss>
