<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
	<channel>
<title>calbear#blog</title><link>http://www.calbear.org/index.html</link><description>Hmmmmmm</description><dc:language>en</dc:language><dc:creator>carsongross@gmail.com</dc:creator><dc:rights>Copyright 2008 Carson Gross</dc:rights><dc:date>2008-07-25T23:53:44-07:00</dc:date><admin:generatorAgent rdf:resource="http://www.realmacsoftware.com/" />
<admin:errorReportsTo rdf:resource="mailto:carsongross@gmail.com" /><sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<lastBuildDate>Fri, 25 Jul 2008 23:54:18 -0700</lastBuildDate><item><title>New Post Up</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-07-25T23:53:44-07:00</dc:date><link>http://www.calbear.org/files/49d36eb0d013a323850dc67b7fe5d6b4-37.html#unique-entry-id-37</link><guid isPermaLink="true">http://www.calbear.org/files/49d36eb0d013a323850dc67b7fe5d6b4-37.html#unique-entry-id-37</guid><content:encoded><![CDATA[At the <a href="http://guidewiredevelopment.wordpress.com/2008/07/25/pragmatic-type-systems/" rel="self">DevBlog</a> regarding GScript&rsquo;s pragmatic type system.]]></content:encoded></item><item><title>Pet Peeve #77</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-07-25T10:43:12-07:00</dc:date><link>http://www.calbear.org/files/9ad7bbe26ef92fc35b013ed97f13cf2c-36.html#unique-entry-id-36</link><guid isPermaLink="true">http://www.calbear.org/files/9ad7bbe26ef92fc35b013ed97f13cf2c-36.html#unique-entry-id-36</guid><content:encoded><![CDATA[When a website asks me for a credit card number and the text box for typing in the credit card # is limited to 16 characters.  I always put spaces in so I can keep track of where I am as I glance back and forth between the credit card and the screen.<br /><br />It&rsquo;s a one liner in any reasonable programming language to strip space characters.  Even in java it&rsquo;s just:<br /><br /><code>String strippedString <font color="#990000">=</font> ccNumber<font color="#990000">.</font><b><font color="#000000">replaceAll</font></b><font color="#990000">(</font> &ldquo; &ldquo;<font color="#990000">,</font> &ldquo;&rdquo; <font color="#990000">)</font><br /></code>
<br />How hard is that?<br /><br />If you really want to make sure only 16 characters are entered on the client side, then do the right thing and put four text boxes next to one another and advance focus when the fourth number is typed into each one.]]></content:encoded></item><item><title>A Culture of Moral Hazard</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-07-24T09:05:29-07:00</dc:date><link>http://www.calbear.org/files/c2db3ee1d5c9bcacf7fa0c42616811d3-35.html#unique-entry-id-35</link><guid isPermaLink="true">http://www.calbear.org/files/c2db3ee1d5c9bcacf7fa0c42616811d3-35.html#unique-entry-id-35</guid><content:encoded><![CDATA[As I was driving back from some golf at <a href="http://www.oldbrockway.com/" rel="self">Old Brockway</a> yesterday, a commercial came on for a bankruptcy law firm.  It featured two women talking to one another.  It opened with the first girl saying &ldquo;Wow, nice car!  I thought you were having financial troubles...&rdquo;  The second woman goes on to explain that she has filed for bankruptcy, using the services of our friendly local bankruptcy lawyers.<br /><br />The commercial ends with the first girl saying &ldquo;By the way, you look <strong>hot</strong> in that car.&rdquo;<br /><br />Twenty years of outrageous moral hazard has sunk into the larger culture.  It&rsquo;s not just for big banks anymore!<br /><br />We are about to discover just how valuable the frugality and modesty of traditional morality were.  Debt expansion can only paper over moral rot for a few decades.]]></content:encoded></item><item><title>RapidWeaver 4</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-07-14T23:30:44-07:00</dc:date><link>http://www.calbear.org/files/2ee43f50f494ae913f38a27b74bd3e41-34.html#unique-entry-id-34</link><guid isPermaLink="true">http://www.calbear.org/files/2ee43f50f494ae913f38a27b74bd3e41-34.html#unique-entry-id-34</guid><content:encoded><![CDATA[<span style="font-size:13px; ">Yay.  I&rsquo;ve upgraded (for free) to RapidWeaver 4.0.<br /><br />Looks much better functionality-wise (single click publishing... awesome) but the icons don&rsquo;t really fit the programs &ldquo;feel&rdquo;<br /><br /></span><img class="imageStyle" alt="Pasted Graphic" src="http://www.calbear.org/files/page1_blog_entry34_1.jpg" width="70" height="64"/><br /><br />Doesn&rsquo;t that just look too, erm, business-like for a mac-ish website builder?<br /><br /><em>_shrug_</em><br /><br />If that&rsquo;s the worst thing I have to say about this awesome software, I think they are doing OK.<br /><strong><br />EDIT:</strong> Yikes.  I must have accidentally selected a different theme, because for a second my site looked like a bad Microsoft-branded box.  All better now.<br />]]></content:encoded></item><item><title>Contra Chesterton...</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-05-20T07:37:22-07:00</dc:date><link>http://www.calbear.org/files/7dbf58bc7474578aa8762b5b4f80230d-33.html#unique-entry-id-33</link><guid isPermaLink="true">http://www.calbear.org/files/7dbf58bc7474578aa8762b5b4f80230d-33.html#unique-entry-id-33</guid><content:encoded><![CDATA[<span style="font-size:13px; "><a href="http://www.rgemonitor.com/roubini-monitor/252638/how-will-financial-institutions-make-money-now-that-the-securitization-food-chain-is-broken/" rel="self">Complexity</a></span><span style="font-size:13px; "> is the last refuge of a scoundrel.<br /><br />I see it all the time with programmers: a mediocre programmer who doesn't understand something starts attacking with nonsense-but-impenetrable jargon, in order to browbeat others into submission.  My understanding is that whole literature departments are dedicated to analyzing this and claiming that all human discourse falls under this category.  Generally, I'm inclined to dismiss them as anti-truth cranks, busy sawing at the bough upon which they sit.  Still, with the banking system,  I can't help but wonder if their thesis applies.</span>]]></content:encoded></item><item><title>Post On Sorting</title><dc:creator>carsongross@gmail.com</dc:creator><category>Guidewire</category><dc:date>2008-05-19T22:10:39-07:00</dc:date><link>http://www.calbear.org/files/3dfddbf944c9748063176da57e973cec-32.html#unique-entry-id-32</link><guid isPermaLink="true">http://www.calbear.org/files/3dfddbf944c9748063176da57e973cec-32.html#unique-entry-id-32</guid><content:encoded><![CDATA[<span style="font-size:13px; ">Up on the guidewire </span><span style="font-size:13px; "><a href="http://guidewiredevelopment.wordpress.com/2008/05/19/sorting-a-list/" rel="self">devblog</a></span><span style="font-size:13px; ">.  <br /><br />Man I love GScript.</span>]]></content:encoded></item><item><title>Keyboards: Microsoft 1&#x2c; Apple 0</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-04-20T21:24:23-07:00</dc:date><link>http://www.calbear.org/files/2af0c0fd7a38644da82d5808aab45aaa-31.html#unique-entry-id-31</link><guid isPermaLink="true">http://www.calbear.org/files/2af0c0fd7a38644da82d5808aab45aaa-31.html#unique-entry-id-31</guid><content:encoded><![CDATA[<span style="font-size:13px; ">I make no secret of the fact that I'm a mac guy.  I much prefer OSX to either Windows or Linux because, unlike windows, there is a full, working userland unix (which is all I care about) and, unlike linux, I don't hate the window manager.  And let us not speak of the windows file system, which regularly takes up 20 to 30 minutes of my day.  Unfortunately, I often let the fact that I prefer OSX to other the other OS's color my judgement on hardware.  A recent case in point was that I purchased an apple wireless keyboard to go with my new MacBook, which I usually have attached to an external monitor.  I thought it would complete the look.  And that it did.<br /><br /></span><img class="imageStyle" alt="wireless_keyboard20070813" src="http://www.calbear.org/files/page1_blog_entry31_1.gif" width="400" height="148"/><span style="font-size:13px; "><br /></span><span style="font-size:13px; "><br />But it also sucks for any extended amount of typing.<br /><br />The key travel is too shallow and it turns out that I really, really need a split keyboard to be comfortable.  So I went with the same keyboard I have at work, except wireless, and with a funky mouse: the Natural Ergonomic Desktop 7000 from, drum roll, Microsoft. <br /><br /></span><img class="imageStyle" alt="mk_NED7k_otherviews_1" src="http://www.calbear.org/files/page1_blog_entry31_2.jpg" width="358" height="190"/><span style="font-size:13px; "> <br /></span><span style="font-size:13px; "><br />I can't tell you how much better this keyboard is than Apples.  As for the mouse, hey, at least it has a second button.<br /><br />That Microsoft, of all companies, can produce kick-ass keyboards and Apple, of all companies, can't is one of God's better jokes.</span>]]></content:encoded></item><item><title>New Post on DevBlog</title><dc:creator>carsongross@gmail.com</dc:creator><category>Guidewire</category><dc:date>2008-04-19T23:12:03-07:00</dc:date><link>http://www.calbear.org/files/0e8aa8525758ccba01081e82d452cba5-30.html#unique-entry-id-30</link><guid isPermaLink="true">http://www.calbear.org/files/0e8aa8525758ccba01081e82d452cba5-30.html#unique-entry-id-30</guid><content:encoded><![CDATA[<span style="font-size:13px; ">I've got  a new post up over on the devblog about how closures and type inference make generics easier to deal with:<br /><br />  </span><span style="font-size:13px; "><a href="http://guidewiredevelopment.wordpress.com/2008/04/20/gscript-java-4/" rel="self">http://guidewiredevelopment.wordpress.com/2008/04/20/gscript-java-4/</a></span><span style="font-size:13px; "><br /><br />Good stuff.</span>]]></content:encoded></item><item><title>Food Poisoning</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-04-04T19:21:49-07:00</dc:date><link>http://www.calbear.org/files/b1b87f81e02b9bb1e54b3baa1dd5a98f-29.html#unique-entry-id-29</link><guid isPermaLink="true">http://www.calbear.org/files/b1b87f81e02b9bb1e54b3baa1dd5a98f-29.html#unique-entry-id-29</guid><content:encoded><![CDATA[<span style="font-size:13px; ">I ate lunch at a mexican joint I had never been to before: </span><span style="font-size:13px; "><a href="http://travel.yahoo.com/p-travelguide-21401095R-la_cumbre_san_jose-i" rel="self">La Cumbre</a></span><span style="font-size:13px; ">.  I have spent the past two hours puking my guts out.<br /><br />I hesitate to recommend the place.</span>]]></content:encoded></item><item><title>Words to live by...</title><dc:creator>carsongross@gmail.com</dc:creator><category>Housing Insanity</category><dc:date>2008-03-22T22:17:19-07:00</dc:date><link>http://www.calbear.org/files/25ee935688b25585ca5d1019a0041456-28.html#unique-entry-id-28</link><guid isPermaLink="true">http://www.calbear.org/files/25ee935688b25585ca5d1019a0041456-28.html#unique-entry-id-28</guid><content:encoded><![CDATA[<a href="http://www.nytimes.com/2008/03/23/business/23how.html?_r=2&ref=business&pagewanted=print" rel="self">&ldquo;If it is too complicated for most of us to understand in 10 to 15 minutes, then we probably shouldn&rsquo;t be doing it.&rdquo;</a><br /><br />It applies to software as much as it applies to banking, but with the sharp distinction that software, by and large, doesn't "require" a taxpayer bailout.  <br /><br />And I mean those quotes to sting.<br /><br />Because I... oh, never mind.]]></content:encoded></item><item><title>New Post at the DevBlog</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2008-03-17T21:54:06-07:00</dc:date><link>http://www.calbear.org/files/365b7995a95451861a094b60c5df5752-27.html#unique-entry-id-27</link><guid isPermaLink="true">http://www.calbear.org/files/365b7995a95451861a094b60c5df5752-27.html#unique-entry-id-27</guid><content:encoded><![CDATA[<span style="font-size:14px; ">I've got a new post up at the DevBlog, discussing Enhancements:<br /><br />&nbsp;&nbsp;</span><span style="font-size:14px; "><a href="http://guidewiredevelopment.wordpress.com/2008/03/18/enhancements-in-gscript/" rel="self">http://guidewiredevelopment.wordpress.com/2008/03/18/enhancements-in-gscript/</a></span><span style="font-size:14px; "><br /><br />Pretty cool feature of GScript.</span>]]></content:encoded></item><item><title>Yeah</title><dc:creator>carsongross@gmail.com</dc:creator><category>Housing Insanity</category><dc:date>2008-03-16T22:31:04-07:00</dc:date><link>http://www.calbear.org/files/e6dba42b85585517fdfc0051db9cc82c-26.html#unique-entry-id-26</link><guid isPermaLink="true">http://www.calbear.org/files/e6dba42b85585517fdfc0051db9cc82c-26.html#unique-entry-id-26</guid><content:encoded><![CDATA[<span style="font-size:14px; ">In the long run we aren't all dead, but Bear Sterns sure is:<br /><br /></span><img class="imageStyle" alt="bsc" src="http://www.calbear.org/files/page1_blog_entry26_1.png" width="744" height="873"/><span style="font-size:14px; "><br /><br />(from http://www.wallstreetbear.com/image/bsc.png)<br /><br />Serial asset bubbles are no way to run an economy.<br /><br />And they won't occur if (when?) we have sound money that isn't controlled by a Wall Street front organization.</span>]]></content:encoded></item><item><title>Dynamic Languages are Wrong</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2008-03-14T21:32:22-07:00</dc:date><link>http://www.calbear.org/files/flaimbait.html#unique-entry-id-25</link><guid isPermaLink="true">http://www.calbear.org/files/flaimbait.html#unique-entry-id-25</guid><content:encoded><![CDATA[<span style="font-size:14px; ">No one is ever going to read this post thus it doesn't matter if I take an absurdly extreme position, so I'm going to come right out and say it:<br /><br /></span><p style="text-align:center;"><span style="font-size:14px; font-weight:bold; ">Dynamic Languages Are Just Wrong For 99% of All Development</span><span style="font-size:14px; "><br /></span></p><p style="text-align:left;"><span style="font-size:14px; "><br />There has been a flurry of excitement over ruby and a few other dynamically typed languages in the last few years, driven mainly by rails on the server side and javascript on the browser.  Rails is a great project and is far better for most websites than the J2EE stack, but that unfortunately obscures the fact that the language it is built on, ruby, while superior to Java in many ways, just isn't the right thing for most developers.<br /><br />This is a relatively new opinion of mine.  You can see </span><span style="font-size:14px; "><a href="http://calbear.org/files/category-ruby.html" rel="self">previous posts</a></span><span style="font-size:14px; "> of mine where I'm very enthusiastic about ruby.  And, at some level, I'm still enthusiastic about it.  Many of the features Ruby offers we've translated into GScript at Guidewire and I'm forever in debt to it for that.  But that doesn't change the fact that I think it is wrong for most developers.  <br /><br />In order to prove this somewhat ridiculous claim, I'll compare what I consider the key features of ruby and how GScript matches up in its statically typed world.<br /><br /></span><span style="font-size:14px; font-weight:bold; ">Terseness</span><span style="font-size:14px; "><br /><br />Ruby is incredibly terse when compared with many statically typed languages.  As a motivating example, a simple enterprise-y method definition might look like this (</span><span style="font-size:14px; "><em>Note: I intentionally include an assignment to a local var in order to contrast with GScript</em></span><span style="font-size:14px; ">):<br /><br /></span><code>&nbsp;&nbsp;<b><font color="#0000FF">def</font></b> employees_over_age<font color="#990000">(</font> age <font color="#990000">)</font><br />&nbsp;&nbsp;&nbsp;&nbsp;emps <font color="#990000">=</font> <font color="#009900">@employees</font><font color="#990000">.</font>find_all <font color="#FF0000">{</font> <font color="#990000">|</font> e <font color="#990000">|</font> e<font color="#990000">.</font>age <font color="#990000">&gt;</font> age <font color="#FF0000">}</font><br />&nbsp;&nbsp;&nbsp;&nbsp;emps<br />&nbsp;&nbsp;<b><font color="#0000FF">end</font></b></code>
<span style="font-size:14px; "><br /></span><span style="font-size:14px; "><br />Compare that with the five to ten lines of java you would have to write to accomplish the same task, with all the generics and types you would have to annotate.  I can't even bear to write it all out.<br /><br />But let's look at the same function defined in GScript:<br /><br /></span><code>&nbsp;&nbsp;<b><font color="#0000FF">function</font></b> <b><font color="#000000">employeesOverAge</font></b><font color="#990000">(</font> age <font color="#990000">:</font> <font color="#009900">int</font> <font color="#990000">)</font> <font color="#990000">:</font> Employee<font color="#990000">[]</font> <font color="#FF0000">{</font><br />&nbsp;&nbsp;&nbsp;&nbsp;<b><font color="#0000FF">var</font></b> emps <font color="#990000">=</font> _employees<font color="#990000">.</font><b><font color="#000000">findAll</font></b><font color="#990000">(</font> <font color="#990000">\</font> e <font color="#990000">-&gt;</font> e<font color="#990000">.</font>age <font color="#990000">&gt;</font> age <font color="#990000">)</font><br />&nbsp;&nbsp;&nbsp;&nbsp;<b><font color="#0000FF">return</font></b> emps<br />&nbsp;&nbsp;<font color="#FF0000">}</font></code>
<span style="font-size:14px; "><br /></span><span style="font-size:14px; "><br />I'll admit, it is more code.  But not a ton more and I think most of the additional code is pretty reasonable:  you have to annotate in and out types at the method level, which is good because you can restrict your implementation details from leaking out of the method.  You have to put an explicit return statement in the code which I actually find more readable.  And you have a slightly more verbose but also more consistent syntax for blocks.<br /><br />So ruby wins in terseness but GScript gets pretty darned close even though it is statically typed.<br /><br /></span><span style="font-size:14px; font-weight:bold; ">Open Classes<br /><br /></span><span style="font-size:14px; ">Ruby elegantly (or hackily, according to tastes) solves another common problem: what if someone hasn't designed a class to your liking, omitting an obvious method or two, and you want to add this functionality to it.  In java, this has lead to a proliferation of *Util classes: StringUtil, ObjectUtil, DateUtil, FileUtil, etc.  There are thousands of these util classes filled with static methods floating around java code bases.  Some code bases are so large (*</span><span style="font-size:14px; "><em>cough*</em></span><span style="font-size:14px; "> Guidewire *</span><span style="font-size:14px; "><em>cough</em></span><span style="font-size:14px; ">*) that there are many multiple different versions of these utility classes, often with subtly different names.</span><span style="font-size:14px; font-weight:bold; "><br /><br /></span><span style="font-size:14px; ">In ruby, you can simply add a method to a class like so:<br /><br /></span><code>&nbsp;&nbsp;<b><font color="#0000FF">class</font></b> String<br />&nbsp;&nbsp;&nbsp;&nbsp;<b><font color="#0000FF">def</font></b> my_method<font color="#990000">()</font><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts<font color="#990000">(</font> <font color="#FF0000">"Holy Crap!!! I've added a method to Strings!"</font> <font color="#990000">)</font><br />&nbsp;&nbsp;&nbsp;&nbsp;<b><font color="#0000FF">end</font></b><br />&nbsp;&nbsp;<b><font color="#0000FF">end</font></b><br /></code>
<span style="font-size:14px; font-weight:bold; "><br /></span><span style="font-size:14px; ">These are referred to as "Open Classes."  Pretty neat, eh?  Well, it's so neat that we decided we needed something like that in GScript, so we added something called Enhancements.  Here is an equivalent Enhancement:<br /><br /></span><code>&nbsp;&nbsp;enhancement MyStrEnhancement <font color="#990000">:</font> String <font color="#FF0000">{</font><br />&nbsp;&nbsp;&nbsp;&nbsp; <b><font color="#0000FF">function</font></b> <b><font color="#000000">myMethod</font></b><font color="#990000">()</font> <font color="#FF0000">{</font><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><font color="#000000">print</font></b><font color="#990000">(</font> <font color="#FF0000">"Holy Crap!!! I've added a method to Strings!"</font><font color="#990000">)</font><br />&nbsp;&nbsp;&nbsp;&nbsp; <font color="#FF0000">}</font><br />&nbsp;&nbsp;<font color="#FF0000">}</font><br /></code>
<span style="font-size:14px; "><br />Not bad, eh?  And because GScript is statically typed and because we provide an IDE for it, you will get very nice code completion when you hit '.' after a string object, with your shiny new method available and quite discoverable.<br /><br />So I think GScript actually wins here by a hair because it formalizes the class extension mechanism in a new language construct, but both are just about equivalent.  The point is that you don't need dynamic typing for this very useful feature.</span><span style="font-size:14px; font-weight:bold; "><br /><br />MetaProgramming<br /></span><span style="font-size:14px; "><br />The really killer aspect of ruby and what lets rails clean J2EE's clock in terms of ease-of-development is the metaprogramming ability you have available.  This allows you to dynamically generate classes on the fly based on, well, whatever you damned well please.  This is how ActiveRecord builds classes based on your database schema, with no code-gen phase in the middle to gunk up the works.  You change the schema and, </span><span style="font-size:14px; "><em>*bam*</em></span><span style="font-size:14px; ">, your class is updated.<br /><br />It's hard to contrast this with GScript's alternative in a succinct, blog-friendly way, but I'll try.  GScript has an "open" typesystem allowing anyone to implement a TypeLoader and custom Types in java (which underlies GScript.)  That TypeLoader can construct its types based on whatever metadata is wants to just like in ruby.  At Guidewire we use this feature to build type systems on top of our web-UI files, on top of our internationalization properties files and on top of our OR layer, to name just a few.  This allows GScript code to access these resources in a typesafe way but without any sort of a code-gen step.<br /><br />GScript's Type System, therefore, is very flexible in much the same way that Ruby's is: developers can implement their API's in terms of types that they create dynamically rather than statically, based on whatever metadata they like.<br /><br /></span><span style="font-size:14px; font-weight:bold; ">An Anti-Feature: DSLs</span><span style="font-size:14px; "><br /><br />A lot of developers are excited about DSL's in ruby that take advantage of the flexible nature of the ruby langauge.  I'm not sure they are such a good idea.  I think developers, on balance, would prefer to program in one sufficiently powerful language.  I would imagine this is especially true in the enterprise space.  I also think language design is pretty difficult and putting a bunch of people to work churning out specialized languages wouldn't turn out as well as we might hope.  I think there may even be a biblical story about that sort of thing.  <br /><br />Rather than domain specific languages, I think there should be domain specific type systems: as I mentioned above we have type systems for our web layer, our OR layer, our permissions layer, etc. and it all works out grand.  You have access to all these resources in a single language, GScript, presented in (one hopes) a nice API shaped by the dynamically generated types of the particular TypeLoader.<br /><br />No new syntax to learn, just more libraries.  Nice.<br /><br /></span><span style="font-size:14px; font-weight:bold; ">So Why Are Dynamic Languages Wrong? <br /></span><span style="font-size:14px; "><br />Really it boils down to two reasons:  tools and static verification.  The first reason is </span><span style="font-size:14px; font-weight:bold; ">far</span><span style="font-size:14px; "> more important than the second one.  <br /><br />Being able to hit '.' and see what the hell you can do with an object is priceless, particularly on larger projects.  I know some people say "don't get involved in larger projects" but, well, sometimes it happens.  Refactor tools (yeah, yeah, SmallTalk, blah blah blah) are far easier to implement correctly with statically typed languages than dynamically typed languages.  And total-program analysis tools become possible.  If the syntactic and expressive price is low enough (and in GScript, it is) then there is no reason to give up all this functionality for a dynamic language.<br /><br />Static verification has gotten a bit of a bad name lately and we often joke at Guidewire that "well, it compiled, it must be right."  Still, when you are making big changes and you have tens of thousands of tests to run, it is really nice to have something relatively fast (a compiler) point out things you have obviously missed at compilation time rather than waiting to run a series of test suites (even on our distributed testing cluster, it often takes up to an hour to hear back about every test after a checkin.)<br /><br />But really, I could have stopped at '.'<br /><br />Good code completion pretty much QED's the argument in my book.</span></p>]]></content:encoded></item><item><title>GScript...</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2008-03-11T22:16:54-07:00</dc:date><link>http://www.calbear.org/files/1db605cfaf5cff611ac1ae385a50f9c1-24.html#unique-entry-id-24</link><guid isPermaLink="true">http://www.calbear.org/files/1db605cfaf5cff611ac1ae385a50f9c1-24.html#unique-entry-id-24</guid><content:encoded><![CDATA[<span style="font-size:13px; ">I'm doing a series of blog posts over at the </span><span style="font-size:13px; "><a href="http://guidewiredevelopment.wordpress.com/" rel="self">Guidewire DevBlog</a></span><span style="font-size:13px; "> on why GScript is a more enjoyable programming language than Java.  I've just put up a recent post that shows some of the special sauce we have added to the language using Enhancements and Generics.  (I'll discuss them later.)<br /><br /></span><span style="font-size:13px; "><a href="http://guidewiredevelopment.wordpress.com/2008/03/14/gscript-java-pt-3/" rel="self">Check it out.</a></span><span style="font-size:13px; "><br /><br />GScript rocks.</span>]]></content:encoded></item><item><title>Now that&#x2c; my friends&#x2c; is a Landcruiser</title><dc:creator>carsongross@gmail.com</dc:creator><category>Landcruisers</category><dc:date>2008-03-10T20:37:12-07:00</dc:date><link>http://www.calbear.org/files/ef9eeb9928b3324b866fd6ca35eccedc-23.html#unique-entry-id-23</link><guid isPermaLink="true">http://www.calbear.org/files/ef9eeb9928b3324b866fd6ca35eccedc-23.html#unique-entry-id-23</guid><content:encoded><![CDATA[<span style="font-size:14px; ">The new 70-series is available in Australia, and she is beautiful:<br /><br />  </span><span style="font-size:14px; "><a href="http://www.toyota.com.au/landcruiser-70-series" rel="external">http://www.toyota.com.au/landcruiser-70-series</a></span><span style="font-size:14px; "><br /><br />Interior:<br /><br /></span><img class="imageStyle" alt="26790" src="http://www.calbear.org/files/page1_blog_entry23_1.jpg" width="720" height="405"/><br /><br />The simple dash is very reminiscent of the 60-series dash.  I <strong>love</strong> it.<br /><br />Here is the troopy version:<br /><br /><img class="imageStyle" alt="Pasted Graphic 2" src="http://www.calbear.org/files/page1_blog_entry23_2.jpg" width="397" height="218"/><br /><br />and the wagon:<br /><br /><img class="imageStyle" alt="Pasted Graphic 3" src="http://www.calbear.org/files/page1_blog_entry23_3.jpg" width="391" height="215"/><br /><br />And finally the bobcat/truck:<br /><br /><img class="imageStyle" alt="Pasted Graphic 5" src="http://www.calbear.org/files/page1_blog_entry23_4.jpg" width="373" height="173"/><br /><br />Check out the available wood tray body!<br /><br /><img class="imageStyle" alt="Pasted Graphic 6" src="http://www.calbear.org/files/page1_blog_entry23_5.jpg" width="388" height="250"/><br /><br />Last but definitely not least, check out the wheels:<br /><br /><img class="imageStyle" alt="Pasted Graphic" src="http://www.calbear.org/files/page1_blog_entry23_6.jpg" width="125" height="141"/><br /><br />Old school.<br /><br />Oh, and it has a V8 diesel that pulls 20 mpg.<br /><br />I really, really, really wish Toyota would release the 70-series here.  There isn't anything close to this sort of vehicle in the U.S. market other than the increasingly obese wrangler.]]></content:encoded></item><item><title>Broken Clock: Right Twice a Day&#x21;</title><dc:creator>carsongross@gmail.com</dc:creator><category>Housing Insanity</category><dc:date>2008-03-09T22:09:17-07:00</dc:date><link>http://www.calbear.org/files/798891691abea699620f6a78cf9b50f6-22.html#unique-entry-id-22</link><guid isPermaLink="true">http://www.calbear.org/files/798891691abea699620f6a78cf9b50f6-22.html#unique-entry-id-22</guid><content:encoded><![CDATA[<span style="font-size:14px; ">I was, oh, about six years early to the housing-bubble party.  It's a lesson learned (along with google's stock price): don't underestimate how long the market can stay irrational because it will make you look very, </span><span style="font-size:14px; font-weight:bold; ">very</span><span style="font-size:14px; "> stupid.  But it seems that now most people are coming around and some people are even talking about </span><span style="font-size:14px; font-weight:bold; ">*gasp*</span><span style="font-size:14px; "> income-price ratios and rent-vs-buy calculations.<br /><br />One of the hard things in the rent-vs-buy calculation is that to do the calculation correctly, you have to make an assumption about the long-term appreciation of the home that you buy.  This is why housing booms are self-reinforcing, even without a feckless central bank: as expected future returns increase, the NPV of houses increase, creating a self-fulfilling cycle.  That, of course, is now being thrown into reverse: why would anyone throw a $50,000 deposit at housing when houses are going down in price?  So a bank can eat that 50K while you ride the down cycle?  Thanks, but no thanks.<br /><br />Putting even further (and perhaps devestating) pressure on house prices will be Baby Boom demographics, as outlined </span><span style="font-size:14px; "><a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2008/03/09/REDHVBQ2L.DTL&feed=rss.bayarea" rel="external">here</a></span><span style="font-size:14px; ">.  The boomers have done a pretty good job of forward-shifting benefits (prescriptions, etc.) and back-shifting costs, but they are going to find that they are selling homes (and stocks) into a smaller market as they finance their retirement.<br /></span>]]></content:encoded></item><item><title>The Housing Bubble&#x2c; or Why I Will Never Be Able To Afford a Home</title><dc:creator>carsongross@gmail.com</dc:creator><category>Housing Insanity</category><dc:date>2005-02-03T20:36:28-08:00</dc:date><link>http://www.calbear.org/files/afdbf9031ad69c7415af04741ef722bc-21.html#unique-entry-id-21</link><guid isPermaLink="true">http://www.calbear.org/files/afdbf9031ad69c7415af04741ef722bc-21.html#unique-entry-id-21</guid><content:encoded><![CDATA[<span style="font-size:13px; ">I have been beating the housing-bubble drum for, ahem, upwards of four years now. I'm a strong believer in "common sense" economics: I didn't buy the internet hype in the late 90's (although I had a few "maybe I'm wrong" moments), and similarly I don't believe the "its a different housing market" arguments now. At some level, housing prices must be tied to incomes. Clearly that relationship has become unhinged. It's my opinion that the reason that it has become unhinged because of historically low interest rates and the fact that people have moved into increasingly leveraged mortgages. Also lurking in the background is my favorite quasi-federal bugaboo: Fannie Mae. Mortgage backed securities have leveraged the perceived stability of housing mortgages into a lucrative securities market which seems Federally backed. This market has the unfortunate effect of reducing or outright eliminating incentives to lenders to find qualified borrowers: if you are just going to sell the mortgage off as a security, who cares?<br /><br />There is a secondary issue as well: at a fundamental economic level, I believe that economic progress is made when people produce things that other people desire. (Of course I think this. I'm an engineer.) Money generated from housing appreciation doesn't really contribute to the overall economy. Rather it works as an inflationary wealth transfer from non-home owners to home owners. In the long run (and in the long run my children are very alive, Mr. Keynes), it is the production of goods that creates a wealthy society, not the trading of those goods.<br /><br />At this point in the game, regardless of if I'm right (Ed: seems unlikely) or wrong, it has gotten to the point that my financial calculations show a clear financial advantage to renting, on the order of tens of thousands of dollars a year, before one takes into account the convenience of not having to care for a property. Lunacy. The only way to win this game is... not to play.<br /><br />UPDATE: Well, <a href="</span>http://patrick.net/housing/crash.html"><span style="font-size:13px; ">someone</a> agrees with me.</span>]]></content:encoded></item><item><title>Why &#x2a;their&#x2a; programming language is cooler than &#x2a;my&#x2a; programming language</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2005-03-04T20:35:25-08:00</dc:date><link>http://www.calbear.org/files/5098bc8ebc87b561a65a20fa1b696f43-20.html#unique-entry-id-20</link><guid isPermaLink="true">http://www.calbear.org/files/5098bc8ebc87b561a65a20fa1b696f43-20.html#unique-entry-id-20</guid><content:encoded><![CDATA[Some haskell code that makes me cry:<br /><br /><pre><br />--Good ol' quicksort<br />quicksort [] =[]<br />quicksort(x:xs) =  quicksort[ y | y <- xs, y < x]<br />                ++ [x]<br />                ++ quicksort[ y | y <- xs, y >= x]<br /><br />--The list of the Fibonacci numbers<br />fib = 1 : 1 : [a+b| (a,b) <- zip fib (tail fib)]<br /></pre><br /><br />Holy. Crap. Too bad I had to get a masters in CS to understand what the hell is going on here. <br /><br />: /]]></content:encoded></item><item><title>Manliness</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2005-03-10T20:34:35-08:00</dc:date><link>http://www.calbear.org/files/071cd745ccb764b17262c658266d37d1-19.html#unique-entry-id-19</link><guid isPermaLink="true">http://www.calbear.org/files/071cd745ccb764b17262c658266d37d1-19.html#unique-entry-id-19</guid><content:encoded><![CDATA[An interesting <a href="http://www.newcriterion.com/archive/23/mar05/mansfield.htm">article</a> in the New Criterion on the topic.]]></content:encoded></item><item><title>More Housing Bubble Ranting</title><dc:creator>carsongross@gmail.com</dc:creator><category>Housing Insanity</category><dc:date>2005-03-29T20:32:46-08:00</dc:date><link>http://www.calbear.org/files/85b2c4b39bee04dc61d387e710bc655c-18.html#unique-entry-id-18</link><guid isPermaLink="true">http://www.calbear.org/files/85b2c4b39bee04dc61d387e710bc655c-18.html#unique-entry-id-18</guid><content:encoded><![CDATA[What's <a href="http://www.aei.org/publications/pubID.22198/pub_detail.asp">infuriating</a> about the current absurd housing bubble is that all of us will be responsible for bailing it out when everything goes pear-shaped. The mortgage market has gotten "too big to fail" and all the major players fully expect the Federal Government (read: us, the taxpayers) to bail them out, as with the S&L crisis.<br /><br />It is lunacy that someone who avoids the run-up, saves diligently and does <a href="http://www.dinkytown.com/java/MortgageRentvsBuy.html">sane, if rudimentary,</a> financial analysis will end up as much on the hook as the people over-extending themselves with interest only loans to squeeze into a 1m+ two bedroom, or, worse, flipping their way to unearned wealth.<br /><br />But then, one must constantly remind oneself, life isn't fair.]]></content:encoded></item><item><title>Millin Landcruiser</title><dc:creator>carsongross@gmail.com</dc:creator><category>Landcruisers</category><dc:date>2005-03-30T20:31:01-08:00</dc:date><link>http://www.calbear.org/files/6685eb707db7f8a4706a3744fe6f102e-17.html#unique-entry-id-17</link><guid isPermaLink="true">http://www.calbear.org/files/6685eb707db7f8a4706a3744fe6f102e-17.html#unique-entry-id-17</guid><content:encoded><![CDATA[In keeping with my general obsession with retro-SUV's, I dug this <a href="http://www.rodmillen.com/Lcruiser.htm">http://www.rodmillen.com/Lcruiser.htm</a> up today. Oh, man, if Toyota had the balls to produce this.<br /><br />It is essentially an old FJ45 body hacked up and stretched over a current Landcruiser/Tundra frame. Note the flat top and large amounts of flat glass for visibility. Note the absence of any plastic or fiberglass. The back is good, if uneventful. I might have gone with a split-back swing out and suicide seats in the back. The side is good, although the set of four creases beneath the larger indentation seem fussy and unnecessary to me. Overall, the impression is "Truck", not "space egg".<br /><br />I'd buy one of these in a heartbeat. Unfortunately, the price is apparently $350,000, a bit steep for me. So my options are either to wait for the FJ Cruiser, which I'm still ambivalent about, or buy an old FJ40 or FJ55, which, restored, cost at least 35K. Not an easy decision.]]></content:encoded></item><item><title>60&#x25;</title><dc:creator>carsongross@gmail.com</dc:creator><category>Housing Insanity</category><dc:date>2005-04-15T20:30:19-07:00</dc:date><link>http://www.calbear.org/files/6f652b1949d49d8449d3e393a2cc41c5-16.html#unique-entry-id-16</link><guid isPermaLink="true">http://www.calbear.org/files/6f652b1949d49d8449d3e393a2cc41c5-16.html#unique-entry-id-16</guid><content:encoded><![CDATA[Over sixty percent of San Francisco homes bought last year were purchased with interest-only loans:<br /><br />http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2005/04/15/HOMES.TMP quote:<br /><br />    "Economists worry, however, that the second part of Gabriel's adage may apply to uber-expensive markets like the Bay Area. Specifically, they cite the large percentage of risky interest-only loans in the market -- 62 percent of total loans in San Francisco last year, according to market researcher LoanPerformance."<br /><br />Lunacy. Stark, utter lunacy.]]></content:encoded></item><item><title>I would like to take a moment</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2005-06-01T20:28:17-07:00</dc:date><link>http://www.calbear.org/files/c855e59fbaa6752354f2cbe5a9f927d3-15.html#unique-entry-id-15</link><guid isPermaLink="true">http://www.calbear.org/files/c855e59fbaa6752354f2cbe5a9f927d3-15.html#unique-entry-id-15</guid><content:encoded><![CDATA[From feverishly studying for finals to relate that Tom Cruise is f**king nuts:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://tinyurl.com/dl8gu">http://tinyurl.com/dl8gu</a><br /><br />That is all.<br /><br />]]></content:encoded></item><item><title>I would like to take a moment</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2005-06-05T20:27:40-07:00</dc:date><link>http://www.calbear.org/files/b232a30a0f55ce4534daa377bda0f1d3-14.html#unique-entry-id-14</link><guid isPermaLink="true">http://www.calbear.org/files/b232a30a0f55ce4534daa377bda0f1d3-14.html#unique-entry-id-14</guid><content:encoded><![CDATA[From feverishly studying for finals to relate that Cold Play sucks.<br /><br />Badly.<br /><br />I mean, I want to stab myself in the eye when I hear them. Actually, I want to stab them in the eye when I hear them.<br /><br />Awful, whiney, passive-agressive (strike that, just passive) eurotrash sissy pop-rock, and everyone seems to think they are the second coming of the Beatles.<br /><br />Ahem. That is all.]]></content:encoded></item><item><title>Testing and Change</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2005-10-14T20:24:18-07:00</dc:date><link>http://www.calbear.org/files/7a5bb7a19b630163ac9012b50d9afcdf-13.html#unique-entry-id-13</link><guid isPermaLink="true">http://www.calbear.org/files/7a5bb7a19b630163ac9012b50d9afcdf-13.html#unique-entry-id-13</guid><content:encoded><![CDATA[Guidewire is an XP-ish shop, and one of the delights of working there is the incredible test infrastructure that they have set up. It has been immensely educational to work with people who take testing so seriously. Now that I have some first-hand experience with this sort of an environment, I have a few tentative observations:<br /><br />    * Test-first development is hard when a GUI layer is involved<br />    * End-to-end tests are not worth the effort until you have a 1.0 product. And perhaps they aren't even worth the effort until you have a 2.0 product, where certain application paths have been established and need to be maintained.<br />    * Unit testing can get really nasty when there are elaborate dependencies between classes<br />          o It is very hard to keep dependencies low. It requires effort at every step. If you aren't constantly watching it, you will introduce them.<br />    * A flexible sample data and configuration generation platform is crucial for a good test environment<br />    * If tests aren't easy to write, they won't get written or they will be written poorly<br />]]></content:encoded></item><item><title>Dynamic Languages</title><dc:creator>carsongross@gmail.com</dc:creator><category>Guidewire</category><dc:date>2005-12-08T20:23:17-08:00</dc:date><link>http://www.calbear.org/files/9a4c045131db708ca7a99a6bbf2d2244-12.html#unique-entry-id-12</link><guid isPermaLink="true">http://www.calbear.org/files/9a4c045131db708ca7a99a6bbf2d2244-12.html#unique-entry-id-12</guid><content:encoded><![CDATA[I gave a Ruby talk here at Guidewire a few weeks ago, and it has been fun to see all the discussion that it has generated. I don't think there is much chance of us using Ruby in any serious way in our core applications, but it could make inroads in the periphery (support code, example integration applications, etc.)<br /><br />Despite how much I love Ruby, I'm still skeptical of how well it will perform in a large system. I just don't have experience with large, dynamically typed systems, and a lot of older engineers I respect shudder at the idea. Maybe the prevalence of unit-testing will change this (Martin Fowler seems to think so.) I guess we will have to wait and see how the Rails projects turn out to provide evidence one way or the other.]]></content:encoded></item><item><title>power_set()</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2005-12-11T20:00:18-08:00</dc:date><link>http://www.calbear.org/files/f3675bdc170ba9e2b07ba8b4c8452904-11.html#unique-entry-id-11</link><guid isPermaLink="true">http://www.calbear.org/files/f3675bdc170ba9e2b07ba8b4c8452904-11.html#unique-entry-id-11</guid><content:encoded><![CDATA[Poked around a bit and didn't see this implementation, which actually came to me in bed last night. (Don't ask.)<br /><br /><img class="imageStyle" alt="Pasted Graphic 3" src="http://www.calbear.org/files/page1_blog_entry11_1.jpg" width="571" height="101"/><br />]]></content:encoded></item><item><title>You know what this blog needs? More power_set().</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2005-12-11T20:20:15-08:00</dc:date><link>http://www.calbear.org/files/01a7404560ed097182ccdacc2b952822-10.html#unique-entry-id-10</link><guid isPermaLink="true">http://www.calbear.org/files/01a7404560ed097182ccdacc2b952822-10.html#unique-entry-id-10</guid><content:encoded><![CDATA[As luck would have it, an email got sent out to our coders list today asking about power set functionality in java. I flippantly replied with my implementation, saying that I was sure that the java equivilent would be just as elegant.<br /><br />A witty exchange of emails followed (the sort of thing that makes you love working at an engineering oriented company), and Jim made the point that all the offered implementations were horribly memory inefficient. He offered an iterator-based solution in java.<br /><br />Well, I for one am not going to stand here and let our favorite little programming language have its name dragged through the mud. So here was the iterative-based solution I came up with:<br /><br /><img class="imageStyle" alt="Pasted Graphic 2" src="http://www.calbear.org/files/page1_blog_entry10_1.jpg" width="572" height="235"/>]]></content:encoded></item><item><title>OK&#x2c; OK&#x2c; OK&#x2c; last one&#x2c; I promise</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2006-01-01T20:10:17-08:00</dc:date><link>http://www.calbear.org/files/7892d0ee77f8465f2c6e1729511c367b-8.html#unique-entry-id-8</link><guid isPermaLink="true">http://www.calbear.org/files/7892d0ee77f8465f2c6e1729511c367b-8.html#unique-entry-id-8</guid><content:encoded><![CDATA[<img class="imageStyle" alt="Pasted Graphic 1" src="http://www.calbear.org/files/page1_blog_entry8_1.jpg" width="577" height="307"/><br /><br />Nowhere near as elegant as the inject method below, but this covers both assignment and block usages, so you can pick your poison. If you pass in a block then you have linear rather than exponential memory usage, although the run time is of course equivalent.<br /><br />OK, I'm done. This is my final answer.<br /><br />Wait... Maybe we should add an optional argument with a default value that limits the output, to prevent inadvertently calling it with an array that will take forever to return...<br /><br /><smile/>]]></content:encoded></item><item><title>All Ordered Combos</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2006-01-01T20:13:25-08:00</dc:date><link>http://www.calbear.org/files/e004fc62218be5494391a3a50ab723b3-7.html#unique-entry-id-7</link><guid isPermaLink="true">http://www.calbear.org/files/e004fc62218be5494391a3a50ab723b3-7.html#unique-entry-id-7</guid><content:encoded><![CDATA[Got a bit obsessed with this last night. The wife is gone, so I have to find something to do with myself.<br /><br /><img class="imageStyle" alt="Pasted Graphic" src="http://www.calbear.org/files/page1_blog_entry7_1.jpg" width="580" height="238"/><br /><br />It's a bit convoluted, although not bad and nowhere near what the java implementation would look like.]]></content:encoded></item><item><title>Greenspan&#x27;s legacy</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2006-01-26T20:11:11-08:00</dc:date><link>http://www.calbear.org/files/8fe17f67f7b76c50cd50ff70392b7bcf-6.html#unique-entry-id-6</link><guid isPermaLink="true">http://www.calbear.org/files/8fe17f67f7b76c50cd50ff70392b7bcf-6.html#unique-entry-id-6</guid><content:encoded><![CDATA[http://tinyurl.com/bzrr8<br /><br />Nothing to see here. Everything is fine. Inflation is low and the economy is humming along.<br /><br />Can I offer you a credit card?]]></content:encoded></item><item><title>CALBEAR.org RELAUNCH&#x21;&#x21;&#x21;1&#x21;</title><dc:creator>carsongross@gmail.com</dc:creator><dc:subject>Blog</dc:subject><dc:date>2008-03-09T16:56:56-07:00</dc:date><link>http://www.calbear.org/files/79e7bb7a4e6ea7b2e80b89ff79d03d10-2.html#unique-entry-id-2</link><guid isPermaLink="true">http://www.calbear.org/files/79e7bb7a4e6ea7b2e80b89ff79d03d10-2.html#unique-entry-id-2</guid><content:encoded><![CDATA[<span style="font-size:14px; ">I know everyone (defined as the searchbots who are the only visitors I ever get) was wondering what the hell happened to this site.  The answer is: nothing.  Nothing happened for two years, while I learned a ton at Guidewire, finally bought an old landcruiser (a '78 FJ40) and, oh, also had a child.  <br /></span><span style="font-size:14px; "><br /></span><span style="font-size:14px; ">But that's going to change now: I'm going to redo the site using RapidWeaver, a website builder for the mac.  I've decided that I'm not a web-designer, and that I just don't want to keep up with the CSS chaos and cross-browser compatibility issues that come with maintaining a site by hand.  I would rather use a normal editor for changing the site rather than emacs and some shell scripts.  Also, I have to admit that the whole rails thing never really worked out as well as I had hoped for.  I'm going to port over a lot of my old blog posts, many of which I disagree with now, just to provide some historical context.<br /><br />I'm posting over at the Guidewire DevBlog and will probably cross-post stuff here as well.
</span>]]></content:encoded></item><item><title>Mail&#x2c; an Odyssey</title><dc:creator>carsongross@gmail.com</dc:creator><category>Tech</category><dc:date>2006-03-08T20:44:00-08:00</dc:date><link>http://www.calbear.org/files/66220a2645ec0d82ac03259953e48f62-1.html#unique-entry-id-1</link><guid isPermaLink="true">http://www.calbear.org/files/66220a2645ec0d82ac03259953e48f62-1.html#unique-entry-id-1</guid><content:encoded><![CDATA[<span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">A longtime member of my list of </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; ">Things To Do</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> has been to move my home email server from my UW-IMAP/mbox based server to a Courier-IMAP/Maildir based system. Earlier this weekend, I came to the realization that I am no longer interested in maintaining a linux server. The bloom is off the rose. I have a perfectly good (in fact, amazingly good) hosting company in Dreamhost. I'll let the pros, who I'm paying anyway, worry about server uptime, security patching, backups and all the rest. Dreamhost already has Courier set up so all I need to do is get my existing mail onto their servers.<br /><br />One small problem:<br /><br />I have on the order of 10,000 emails going back six years, all in mbox format.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />Attempt 1:</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> Oh, I'll just run my home imap server and my dreamhost imap server side by side in Mail.app, and copy the emails over.<br /><br />Er...<br /><br />Boy that's slow.<br /><br />And boy is Mail.app bogging badly.<br /><br />Holy CRAP that's slow!<br /><br />And now my dreamhost terminal connection is barely responding.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />ABORT, ABORT, ABORT!</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />Deep breath. OK.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />Attempt 2:</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> So clearly IMAP to IMAP communication isn't going to work well. So, what else can we do? Well, I can just scp the mbox files to my local machine, <br />import them into Mail.app as local messages, and upload them from here to dreamhost...<br /><br />Hmmm. Well, mbox import sucks in Mail.app. But I'll wait it out, because I'm sure it will be a smokin' upload.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em><br />taps fingers</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">...<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em><br />goes off to do other things</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">...<br /><br />And we're back. OK, everything is loaded into mail. Admittedly, the CPU is pegged and the machine is barely usable, but that's because Spotlight is indexing all this temporary content like a coked up rabbit.<br /><br />So, kill Spotlight's various processes and hope that the machine doesn't hang. Well, it doesn't </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>hang</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> per se, but it has stopped accepting click events.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em><br />Expletive Removed</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">..<br /><br />OK, log out, and log back in. Miracles of miracles, the UI works and the email is locally available. Ready to try to upload. Here we go...<br /><br />Err....<br /><br />It's </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>slower</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> than the IMAP to IMAP copy?!?<br /><br />I'm struggling with how this is even technically possible...<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />ABORT, ABORT, ABORT!</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />Deep breaths. Deep, Deep breaths. OK.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />Attempt 3:</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> OK, Mail.app clearly sucks at this sort of thing. Let's download Thunderbird, which makes my eyes bleed, but has a reputation for a pretty solid IMAP implementation.<br /><br />Local mbox import is a dream, performance-wise, but pretty technically obscure. Always knew that CS masters would come in useful at some point.<br /><br />Try uploading again.<br /><br />After about 10 minutes, my head is in my hands, and I'm quietly sobbing. I hit the cancel button.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />Attempt 4:</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> Now, it's pretty clear that we've established that IMAP, whatever it's virtues, is not a protocol that sings when dealing with bulk operations. So why don't we use protocols that are. I scp my mbox files up to the dreamhost server.<br /><br />Er... Now what? Part of the whole point of moving them over via IMAP copy was to convert from mbox to Maildir.<br /><br />Well, there is an mb2md perl script for converting from mbox to Maildir. But first things first. If I'm going to have to deal with all this stuff locally, it's time to do some research on exactly how the Maildir file format works...<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em><br />2 hours of googling</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />OK. Now I that I have a vague understanding of how it works, let's run the script.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em><br />nothing happens</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />Hmmm. Is it working? It's clearly doing </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; ">something</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">, since my shell is bogged down, and top says it isn't dormant. But I'm a funny sort of user: I like to have feedback.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em><br />ctrl-c</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />I dug around and found the inner loop in the perl script, and stuck a print statement in, which made me feel better.<br /><br />The entire conversion took about 40 minutes, making me more sympathetic to the plight of IMAP, and causing me to pause and reflect on the confounding usefulness of the perl programming language.<br /><br />So, now I've got my email in the right format, but not in the IMAP Maildir directory. So let's just copy them in.<br /><br />Er...<br /><br />Holy crap that copy is slow.<br /><br />Is this stuff network mounted or something? </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>shrug</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> Well, whatever the case, it's not getting faster than this.<br /><br />An hour later, the copy is complete, and I'm even more willing to let IMAP's problems slide.<br /><br />OK, now that everything is in, its time to log in with Thunderbird and start reorganizing my imported email...<br /><br />Select 100 mails, create a new folder, and move them over.<br /><br />And wait.<br /><br />And wait.<br /><br />And... </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>server time out</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">.<br /><br />G*DD**MIT!<br /><br />OK, OK. Look at the folders. Well, the messages were moved (at least some of them), but they weren't deleted from the original folder.<br /><br />Now I'm in a really terrifying state, where I don't know how inconsistent the data has become.<br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />ABORT, ABORT, ABORT!</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />Attempt 5:</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> The key realization hits me: mutt, my favorite term-based email client, speaks Maildir! Dreamhost has it installed, of course. I put the appropriate hieroglyphs in my .muttrc, and blam, I'm slicing and dicing my email </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; ">locally</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">, with only minimal bog.<br /><br />Furthermore, mutt has built in functionality for removing redundant emails from email directories, so I can just organize as I wish, and not worry about creating duplicates since I can open the folders up and remove them easily. </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>Beautiful</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">.<br /><br />Now if I had just realized all that back at attempt 1.</span>]]></content:encoded></item><item><title>Java and XML: Let&#x27;s not use them together</title><dc:creator>carsongross@gmail.com</dc:creator><category>Programming</category><dc:date>2006-03-12T16:42:00-08:00</dc:date><link>http://www.calbear.org/files/444d49fede2500cdd936b672fe0a90c1-0.html#unique-entry-id-0</link><guid isPermaLink="true">http://www.calbear.org/files/444d49fede2500cdd936b672fe0a90c1-0.html#unique-entry-id-0</guid><content:encoded><![CDATA[<span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">My dissatisfaction with both java and XML is fairly well documented in previous posts. To recap two major points:<br /><br /></span><ul class="disc"><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">Java isn't flexible enough, both syntactically and with respect to it's type system. (Let's leave aside the lack of a reasonable lambda-style syntax for the moment, which is higher on my </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>List of Things That Make Me Cuss When I'm Programming In Java</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">, but is not as relevant for this article.)</span></li><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">XML is, by design, horrifically redundant. (This is </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>almost</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> acceptable for what it was intended to be: a non-human readable data format that didn't have the negative connotations associated with s-expressions. It is totally unacceptable now that people are forced to look at it all day long.)</span></li></ul><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br />What I'd like to look at in this post is why I think XML has become such a huge part of java development and why I think that is unfortunate. The short answer to the first part is:<br /></span><p style="text-align:center;"><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; "><br />People need Domain Specific Language (DSLs)</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /></span></p><p style="text-align:left;"><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />Why do people need DSL's? Because there are whole chunks of applications that don't need a full, general programming language, and for which a full, general programming language is poorly suited. O/R mapping is a good and common enough example. Build tools are another: you want a syntax that encapsulates the common operations so you don't end up generating reams of general code to do basic activities.<br /><br />As noted in </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; color:#5F89B3;">this</a></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> paper, there is a continuum between libraries and DSLs. So, why have DSLs at all? Why not simply design libraries?<br /><br />The answer to that question is: syntax. As much as academics might scoff at it, syntax matters, and it matters </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; ">a lot</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">.<br /><br />This is precisely why ruby is enjoying so much success right now: ruby's syntax and evaluation rules are so flexible that it allows you to create minimal, expressive DSL's with very little effort. You simply have to get your head around how meta-programming in ruby works, and you are off to the races. Ruby on rails is a DSL for building web applications, and a pretty darned good one.<br /><br />Java is, of course, much more locked down than ruby. And this isn't necessarily a bad thing. The java designers were coming from a world replete with horrible C macro-kludges, so it's understandable that they decided to leave out syntactic extensions. If every man is a language designer, you end up with a ton of badly designed languages. But you also end up with a few very well designed ones. And I'm not entirely convinced that the vast majority of useful, small DSL's aren't simply badly designed languages that answer a particular specific need, akin to German's relationship with soldiering.<br /><br />In any even, that's wandering a bit off point. The facts on the ground today are that java developers have been in need of a way to design and implement DSL's for a while now (even when they don't call it that) and the accepted way to do it has become XML. Why?<br /><br />My theory is this: in java, DSL's usually start out as a library, then progress to a library with a smidgen of configuration. XML became the de facto standard for config files during the .com boom, property files apparently not being cool enough, so config information ended up in XML files. Additionally, XSD's give us a rudimentary language syntax (though not semantic) verification tools.<br /><br />All fine and well. I might pick another syntax for structured configuration (say, </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; color:#5F89B3;">YAML</a></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">), but whatever. XML is reasonably suited for simple declarative programming.<br /><br />But then we java developers started doing more and more in those config files and, at some point, they began to cross over that invisible line and become </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><em>semantically crucial parts of our applications</em></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">. They no longer simply contained a few flags used to slightly modify runtime behavior. They became an XML-based programming language for crucial subsystems.<br /><br />This is unfortunate, for many reasons. Among them:<br /><br /></span><ul class="disc"><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">We have traded java, a language that, while certainly not beautiful, is at least plausible for one that </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; font-weight:bold; font-weight:bold; ">was never designed for human consumption</span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">. XML is utterly miserable to use in large quantities. See ant build files, and weep.</span></li><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">We now have to think in two different syntaxes. I maintain that this is a difficult transition for a significant portion of the programming populace.</span></li><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">We cannot have any sort of locality with related java code. Again, the syntax is so utterly foreign that it is like mixing Japanese and English. Even if we could put it in the same file, or add IDE support to navigate from one to the other, it wouldn't work well.</span></li><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">And, most interestingly to me, it becomes difficult to communicate whatever type information we have built into our DSL to Java. We have two choices I can see:</span></li></ul><ul class="disc"><li><ul class="circle"></ul></li><li><ul class="circle"></ul></li></ul><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "><br /><br />So, that outlines why I think we ended up with so much XML in our java applications, and why I view that as an unfortunate thing. Now the hard part: what can be done about it.<br /><br />Frankly, I have no idea.<br /><br />My first reaction is that we need to open up java with a type-safe macro language to allow for syntactic extensions. But as nonchalant as ruby has made me about language extensions, it still seems insane in java. The macro (meta?) language needs the ability to communicate with the java type system easily, making it easy to generate coherent error messages.<br /><br />I realize, of course, that I may simply be saying something as absurd as "let's make hard problems easy," but I have to believe that there is a better way than the current state of things.<br /><br />I'm going to spend some quality time with O'caml/camlp4 over the next month and see if I get anything out of it.<br /><br />Related Links:<br /></span><ul class="disc"><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; ">Wikipedia link on </span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; color:#5F89B3;">DSLs</a></span></li><li><span style="font:14px Arial, Verdana, Helvetica, sans-serif; color:#5F89B3;">Camlp4</a></span><span style="font:14px Arial, Verdana, Helvetica, sans-serif; "> - O'caml's DSL support framework</span></li></ul></p>]]></content:encoded></item></channel>
</rss>