<?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>@TheKeyboard &#187; Clojure</title>
	<atom:link href="http://www.littlehart.net/atthekeyboard/tag/clojure/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.littlehart.net/atthekeyboard</link>
	<description>Facebook should&#039;ve be written in unicornSchemaLang, because everyone *knows* that PHP is no good for anything, right?</description>
	<lastBuildDate>Thu, 29 Jul 2010 20:05:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>People Who Make Me Feel Stupid: Rich Hickey</title>
		<link>http://www.littlehart.net/atthekeyboard/2010/03/03/people-who-make-me-feel-stupid-rich-hickey/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</link>
		<comments>http://www.littlehart.net/atthekeyboard/2010/03/03/people-who-make-me-feel-stupid-rich-hickey/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 14:00:06 +0000</pubDate>
		<dc:creator>Chris Hartjes</dc:creator>
				<category><![CDATA[Chris' Brain]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[event-driven programming]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[Rich Hickey]]></category>

		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/?p=680</guid>
		<description><![CDATA[This is the third in a series of blog posts where I talk about people who&#8217;s skills as programmers make me feel stupid. Check out my thoughts on Geoffrey Grosenbach and Antirez. As a person who learned the hard way about how tough it is creating web applications that can handle state and concurrency issues [...]]]></description>
			<content:encoded><![CDATA[<p><i>This is the third in a series of blog posts where I talk about people who&#8217;s skills as programmers make me feel stupid.  Check out my thoughts on <a href="http://www.littlehart.net/atthekeyboard/2010/03/01/people-who-make-me-feel-stupid-geoffrey-grosenbach/">Geoffrey Grosenbach</a> and <a href="http://www.littlehart.net/atthekeyboard/2010/03/02/people-who-make-me-feel-stupid-antirez/">Antirez</a>.</i>
</p>
<p>
As a person who learned the hard way about how tough it is creating web applications that can handle state and concurrency  issues (if you&#8217;ve ever seen MySQL replication lag times as high as 30 *minutes* you can sympathize), the rise of languages designed from the ground up to support concurrency has caught my eye.  If you&#8217;ve heard of <a href="http://erlang.org">Erlang</a> or <a href="http://www.haskell.org/">Haskell</a> you are somewhat familiar with the topic.
</p>
<p>
Then one day I ran across <a href="http://clojure.org/">Clojure</a>, a language that is a dialect of Lisp but runs on the JVM.  My, my, what in interesting combination.  I&#8217;ve talked about Clojure before, but I have not talked about the amazing person behind it, <a href="http://en.wikipedia.org/wiki/Rich_Hickey">Rich Hickey</a>.
</p>
<p>
The idea of <a href="http://createyourproglang.com/">creating your own programming language</a> is one that I find extremely intimidating, not having a formal background in computer science.  I have a vague idea of how you would do it:  write parsers for your code and then compile them into byte code that can be run by something.  Very simplistic, I know.
</p>
<p>
So Rich Hickey is a one of these programming gurus who I am sure is a super-nice guy but I would be totally intimidated to have any sort of meaningful programming-related discussion with.  First of all, he&#8217;s a Lisp hacker.  Some of my friends have described Lisp as &#8220;the cockroach of the programming world, which will be around long after the sun of other languages have dimmed&#8221; and I can&#8217;t say that I disagree much with that statement.  For someone who learned to program by teaching himself PHP, Lisp&#8217;s syntax takes a lot of getting used to.
</p>
<p>But then I think the best trick was making Clojure run on the <a href="http://en.wikipedia.org/wiki/Jvm">JVM</a>.  Why do I think this is significant?  It means that if there is a feature or a library that doesn&#8217;t exist in Clojure, you can always use a Java equivalent (if such a one exists).  In Tim Bray&#8217;s &#8220;Concur Next&#8221; series he showed an example where he used a Java library in Clojure to help him speed things up.
</p>
<p>
So not only does he have a well-designed and well-thought-out programming language, he is also great at explaining programming concepts.  Go and watch this video on the topic of <a href="http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey">basic principles like state, identity, value, time, and many others</a> in order to understand how to build concurrent and parallel systems.  Fascinating talk, and I highly recommend seeking out other talks that he&#8217;s done as well.
</p>
<p>
All this stuff is absolutely fascinating to me, because my entire programming career has been spent in the stateless environment of the web.  Oh sure, we can fake state and concurrency using sessions and cookies, but they are really just hacks.  Does a web application need to be stateful and/or concurrent?  The answer is, of course, it depends. <img src='http://www.littlehart.net/atthekeyboard/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   Online games with multiple participants definitely need to worry about sharing state across multiple clients, and any web application that is taking large amounts of data and processing it (like munging it together based on aggregate conditions) could benefit from being able to crunch the data concurrently, with all jobs reporting stuff as they go.  Any task that would benefit from being broken down into smaller tasks that can be run at once is a candidate for concurrency.
</p>
<p>
So, why does Rich Hickey make me feel stupid?  <b>Not only is he also capable of explaining the hows and whys of a concurrent programming language, he is encouraging people to think ahead to the next generation of programming problems and potential solutions to those problems.</b>.  It&#8217;s highly unlikely I will ever create a full-blown, general-purpose programming language.  But Rich Hickey&#8217;s work has gotten me thinking about programming in event-driven environments, and wondering what tasks that my current applications perform could benefit from concurrency and parallelism.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.littlehart.net/atthekeyboard/2010/03/03/people-who-make-me-feel-stupid-rich-hickey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who Cares What I Think?</title>
		<link>http://www.littlehart.net/atthekeyboard/2010/01/08/who-cares-what-i-think/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</link>
		<comments>http://www.littlehart.net/atthekeyboard/2010/01/08/who-cares-what-i-think/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 02:50:36 +0000</pubDate>
		<dc:creator>Chris Hartjes</dc:creator>
				<category><![CDATA[Chris' Brain]]></category>
		<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Jython]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pig]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/?p=638</guid>
		<description><![CDATA[So we&#8217;re at a natural point for reflection. It&#8217;s the start of a new year *and* the start of a new decade. Despite my wife rolling her eyes talking about this, it is an incredibly exciting time to be involved in web development. Internet time is like dog time, in my opinion: one year online [...]]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;re at a natural point for reflection.  It&#8217;s the start of a new year *and* the start of a new decade.  Despite my wife rolling her eyes talking about this, it is an incredibly exciting time to be involved in web development.  Internet time is like dog time, in my opinion: one year online is seven years in the real world.  Of course, this is a gross oversimplification.  But I think it&#8217;s accurate nonetheless.
</p>
<p>
So as we start 2010, and you&#8217;re a web developer, what is out there for you to play with?  Let&#8217;s see&#8230;</p>
<ul>
<li>Mature web application frameworks for the Big 3 open source scripting languages (PHP, Python and Ruby) that can help you, when used properly, rapidly build applications, if you are willing to spend the time understanding the limitations of frameworks.  You might hate frameworks, but you certainly cannot ignore them.  Yes, you could consider WordPress itself to be a framework</li>
<li>Multiple languages that will run on the JVM that can be used for web development, if you are willing to spend the time understanding the JVM and how to get these things talking to Java as well.  Ignore the Java haters, I think this is a good trend.</li>
<li>Multiple actually-usuable-outside-of-small-projects alternatives to RDBMs, if you are willing to spend the time to figure out when you should use them.  The trend is towards having ridiculous amounts of data, and it appears that in the open source world the RDBMs is not up to the task.  Think <a href="http://incubator.apache.org/cassandra/">Cassandra</a>, <a href="http://code.google.com/p/redis/">Redis</a> and <a href="http://hadoop.apache.org/">Hadoop</a> along with <a href="http://hadoop.apache.org/pig/">Pig</a>.</li>
<li>multiple mature Javascript libraries that make creating all that awesome Ajax goodness easy, if you are willing to spend the time to pick one with the features you like</li>
<li>multiple mature (or soon-to-be mature) functional programming languages that can be used to build web applications, if you are willing to spend the time to learn functional programming.  I mean, really, how can you not look at <a href="http://clojure.org/">Clojure</a> and <a href="http://ftp.sunet.se/pub/lang/erlang/index.html">Erlang</a> and not be impressed?</li>
</ul>
<p>
But again, who cares what I think?  If you do care, then you are at the same place as me:  paralysis by analyses.  What framework should I pick?  Do I go document database or key-value store?  If I don&#8217;t want to learn Java, can I do some stuff with <a href="http://www.scala-lang.org/">Scala</a> or see if <a href="http://www.jython.org/">Jython</a> is up to the task?  Can <a href="http://www.jquery.org">jQuery</a> do long-polling / comet stuff?  Is functional programming too weird for a web monkey like me to figure out?
</p>
<p>
Crap, that&#8217;s a lot of stuff to worry about, isn&#8217;t it?  Is it any wonder I get stressed out trying to figure out how to build stuff at work?  Or what stuff to dabble with in my spare time?  We are suffering from an embarrassment of riches, which is being hidden by the constant religious wars that developers seem to get embroiled in.  If it&#8217;s not &#8220;my language is better than your language&#8221;, it&#8217;s &#8220;my editor is better than your editor&#8221;.  &#8220;My programming paradigm is better than your programming paradigm.&#8221;  &#8220;If you did interesting work, you&#8217;d get accepted to speak at conferences more&#8221;.  (Sorry, that was me arguing with myself).
</p>
<p>
If anything, I have found that my focus is starting to change.  I&#8217;ve started realizing that what is really happening is that despite there being ridiculous amounts of choices of tools to solve problems, it has become EASIER to solve these problems.  In my planning for a work project I stumbled across the now-infamous <a href="http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html">Rasmus Lerdorf &#8220;The no-framework PHP MVC framework&#8221; blog post</a>.  While Rasmus is a programming god, he is also a very smart guy.  He understands that programming is about solving problems, and he (at least to me) seems to not have the ego that says you must build up your own complicated solutions to problems.
</p>
<p>
This has gotten me to consider how I had been approaching problems.  Too often, I have been approaching them from the code out to the display.  Worrying about the technology, instead of how people will use it.  Rasmus proposes an easy problem &#8211; a sample Ajax app that uses exactly 4 things: a scripting language, a Javascript library, a data storage source, and a data exchange format.  In his specific example he used (in order) PHP 5, Yahoo YUI,  sqlite and JSON.  You could&#8217;ve done this with Python, JQuery, MySQL and XML.  Or Ruby, Dojo, CouchDB, and JSON.  My point is that we often find ourselves caught up in what we are USING to build something rather than solving the problem.
</p>
<p>I have really dislike the idea of New Year&#8217;s resolutions, because they are almost always broken.  But in this case, I think a few are warranted:  this year I resolve to do a better job of figuring out the problem I need to solve first and worry about the technology needed second.  Sometimes my desire to feed the part of me that wants the new and shiny takes control and creates a potentially bad solution.  Sure, it would be awesome to get paid to learn a new programming language and a new web application framework to go with it, but if it gets in the way of solving the problem, well, you&#8217;ve suddenly become the problem instead of the solution.  Sounds so cliched, doesn&#8217;t it?
</p>
<p>
So, in the spirit of that, let&#8217;s look at 3 problems I need to solve in the next little while that I perhaps can also use to feed the Imp of the New and Shiny:</p>
<ul>
<li>Analysis of some MySQL slow-query logs are needed at work.  First solution was to play with a tools specifically for analyzing the slow query log.  They provided summaries that were simply not useful to me. Perhaps Pig + Hadoop will give me the high-level solution to collect the information we seek.</li>
<li>I have a very simple idea for collecting absurd stories you&#8217;ve told to your kids.  My first instinct was to create the project using a web application framework.  Upon reflection, perhaps the combination of WordPress and then a custom-written story submission and approval system is the better approach.</li>
<li>Plans are being made to create the next platform our company will use for online fantasy games.  Since we cover multiple sports, I have no desire to create a separate version of the platform for every sport.  Instead, inspired by the realization that Rails is nothing more than a DSL (or Domain Specific Language) on top of Ruby, I have started work on a very simple DSL for defining scoring rules.  Wouldn&#8217;t it be awesome for the games admin to be able to select a stat category for a sport (say, rushing yards in football) and then use &#8220;(1 point each 10) + (5 at 100 total)&#8221; as the scoring rule?  Parsers are actually pretty easy as long as your DSL is consistent.</li>
</ul>
<p>
I hope I&#8217;ve made sense here, as I&#8217;m trying to show how I wish to change my approach to solving programming problems.  There is no doubt that I will pick up the new and shiny as I find a way to solve these problems.  Some might be written in PHP.  Some will be written in Python.  Some will be written in ScoreRule (to pull a name for my sports DSL out of my ass).  But the real winner is the people who will use these things.  Shhh, don&#8217;t tell anyone:  I&#8217;m thinking about the end user for once instead of the programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.littlehart.net/atthekeyboard/2010/01/08/who-cares-what-i-think/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What&#8217;s In Chris&#8217; Brain &#8211; Christmas 2009 Edition</title>
		<link>http://www.littlehart.net/atthekeyboard/2009/12/22/whats-in-chris-brain-christmas-2009-edition/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</link>
		<comments>http://www.littlehart.net/atthekeyboard/2009/12/22/whats-in-chris-brain-christmas-2009-edition/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:51:35 +0000</pubDate>
		<dc:creator>Chris Hartjes</dc:creator>
				<category><![CDATA[Chris' Brain]]></category>
		<category><![CDATA[Amy Hoy]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[dream jobs]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[hiding behind the mortgage]]></category>
		<category><![CDATA[Orbited]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Twisted]]></category>

		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/?p=635</guid>
		<description><![CDATA[With Christmas quickly approaching, it&#8217;s time to dump all the junk rattling around in my head and into the blog. I hope you have a great holiday season. Concurrency is coming, better be ready The Continuation Mondad in Clojure. Even if you hate Lisp (I&#8217;m looking at you, Kevin) or don&#8217;t give a damn about [...]]]></description>
			<content:encoded><![CDATA[<p>With Christmas quickly approaching, it&#8217;s time to dump all the junk rattling around in my head and into the blog.  I hope you have a great holiday season.</p>
<p><h3>Concurrency is coming, better be ready</h3>
</p>
<p><a href="http://intensivesystems.net/tutorials/cont_m.html">The Continuation Mondad in Clojure</a>.  Even if you hate Lisp (I&#8217;m looking at you, Kevin) or don&#8217;t give a damn about <a href="http://clojure.org/">Clojure</a> it is worth reading about to understand how you can write concurrent applications.</p>
<h3>Real-time web applications are coming, better be ready</h3>
<p>I have a new project I am going to be starting at work, one that can potentially involve real-time information.  Check out this series on <a href="http://thingsilearned.com/2009/06/09/starting-out-with-comet-orbited-part-1/">how to build real-time web applications using Django, Python and a javascript library called Orbited</a>.  When you combine this with the you-can-see-it-on-the-horizon-but-not-quite-here-yet concept of <a href="http://armstrongonsoftware.blogspot.com/2009/12/comet-is-dead-long-live-websockets.html">web sockets</a>, I can see some of the concepts of what I called Web Pi (3.14159, get it?  Get it?  Um okay, any way) starting to take shape.</p>
<h3>TDD With PHP is already here, where have you been?</h3>
<p>Giorgio Sironi has gone and <a href="http://giorgiosironi.blogspot.com/2009/12/practical-php-testing-is-here.html">written the book I was thiking of writing this winter</a>.  If you want to learn more about doing TDD with PHP, go and grab a copy of his e-book.  It&#8217;s 100% free, but I liked it so much (and admired him for tackling a topic I have interest in) I donated $10 to him.  You should do the same.</p>
<h3>Chris should not post links on Twitter that cannot be discussed in 140 characters or less</h3>
<p>Finally, on Twitter I posted about <a href="http://devcomponents.com/blog/?p=633">this blog post</a> which talked about how it&#8217;s only people who are financially secure who pound away at the &#8220;only do what you love&#8221; message.  When you don&#8217;t have to work, that&#8217;s easy to do.  I got into a long conversation with <a href="http://slash7.com">Amy Hoy</a> about this topic, although Twitter is a crappy medium for doing this sort of thing.</p>
<p>
I respect Amy a great deal, so I was kind of bummed when she and I appeared to disagree on some the key points of the blog posting.  Basically, &#8220;do what you love&#8221; is a lie because it is not always possible.  &#8220;Do what you do, with love&#8221; is a better approach to thing.  Not everyone gets to work on exactly what they want to, so perhaps I am showing some signs of neo-puritanism or something when I said &#8220;well, even if you have a crummy job you should be doing it as best as you can.&#8221;  I proceeded to be smacked around by several people who do not share that philosophy.  Amy seemed to feel that the blog article was (to use her words) bullshit and was advocating &#8220;eating a shit sandwich and liking it&#8221; by giving people justification for &#8220;hiding behind the mortgage&#8221; as an excuse for not taking chances.  It will no doubt surprise Amy that I happen to agree with her, but utterly failed to get that across on twitter.  My apologies to Amy for that.  We&#8217;ve all worked crummy jobs, and it has been my personal experience that the best way to get out of a crummy job is to work as hard as you can to build up your skills so you are ready to leap on better opportunities when they come around.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.littlehart.net/atthekeyboard/2009/12/22/whats-in-chris-brain-christmas-2009-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
