<?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>not(this)</title>
	<atom:link href="http://nothis.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nothis.wordpress.com</link>
	<description>Just another WordPress.com site</description>
	<lastBuildDate>Thu, 13 May 2010 17:22:10 +0000</lastBuildDate>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nothis.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>not(this)</title>
		<link>http://nothis.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nothis.wordpress.com/osd.xml" title="not(this)" />
	<atom:link rel='hub' href='http://nothis.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Gone to ground</title>
		<link>http://nothis.wordpress.com/2010/05/13/gone-to-ground/</link>
		<comments>http://nothis.wordpress.com/2010/05/13/gone-to-ground/#comments</comments>
		<pubDate>Thu, 13 May 2010 17:22:10 +0000</pubDate>
		<dc:creator>dmwlff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nothis.wordpress.com/?p=31</guid>
		<description><![CDATA[We got a bunch of invaluable feedback by releasing msjs under open source and showing it to a few people. A lot of people simply don&#8217;t get it. It&#8217;s very different from how people are currently thinking about building AJAX &#8230; <a href="http://nothis.wordpress.com/2010/05/13/gone-to-ground/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=31&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We got a bunch of invaluable feedback by releasing <a href="http://github.com/openmsjs/msjs">msjs</a> under open source and showing it to a few people. A lot of people simply don&#8217;t get it. It&#8217;s very different from how people are currently thinking about building AJAX apps, so I understand that to make it broadly useful, we&#8217;d have to do more to explain <em>why</em> msjs works the way it does.</p>
<p>But after taking a closer look at the awesome <a href="http://nodejs.org">node.js project</a>, I also realized that we made a big mistake in the design of msjs. I think we took a wrong turn when we based our design on the servlet model that treats each server request as a separate process running in its own thread. Node has this dead right, and everyone else gets it wrong: the default should be to have a single thread of execution and to model individual requests as data passing through that single program. I have some ideas about how to adapt a few of the ideas in msjs to this kind of architecture.</p>
<p>I was also surprised and disappointed to find that V8, and the JS community in general, has abandoned the idea of E4X. While I agree that a lot of the E4X syntax is awful, I found it really useful to embed XML literals in my code, and to invert the usual relationships between code and templates. A more compatible version of msjs would have to use separate templates for its HTML, as sad as I&#8217;d be to lose that feature.</p>
<p>The final bit of feedback we got was around our use of closures. A big part of what msjs does is about preserving function environments and moving them from the server to the client, and I got mixed reactions to this. The Java programmers really liked the simplicity and elegance. The JS folks, who are struggling with these issues, didn&#8217;t like our reliance on a non-standard <a href="http://en.wikipedia.org/wiki/Metaobject#Metaobject_protocol">MOP</a> call to gather that info. The consensus among the JS web frameworks appears to be that even though the server code and the client code are written in the same language, they don&#8217;t really overlap, or even touch. Functions get moved from the server to the client essentially as strings.</p>
<p>I just can&#8217;t accept that. We need to be able to think of these client-server apps as a single program with multiple entry points. I have some thoughts on how to do this, but I&#8217;m taking a break for the moment. I&#8217;m working on a business deal that I hope to be able to announce soon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nothis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nothis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nothis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nothis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nothis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nothis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nothis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nothis.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=31&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nothis.wordpress.com/2010/05/13/gone-to-ground/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27b5e1bd848a50f92f8dad6839c59671?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmwlff</media:title>
		</media:content>
	</item>
		<item>
		<title>msjs programming demo</title>
		<link>http://nothis.wordpress.com/2010/04/25/msjs-programming-demo/</link>
		<comments>http://nothis.wordpress.com/2010/04/25/msjs-programming-demo/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 23:37:00 +0000</pubDate>
		<dc:creator>dmwlff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nothis.wordpress.com/2010/04/25/msjs-programming-demo</guid>
		<description><![CDATA[I recorded a little screencast showing how to program in msjs. <a href="http://nothis.wordpress.com/2010/04/25/msjs-programming-demo/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=6&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recorded a little <a href="http://vimeo.com/11217183">screencast showing how to program in msjs.</a> Let me know what you think!</p>
<div style='text-align:center;'>
<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.vimeo.com/moogaloop.swf?clip_id=11217183&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA">
	<param name="quality" value="best" />
	<param name="allowfullscreen" value="true" />
	<param name="scale" value="showAll" />
	<param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=11217183&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA" />
	<param name="wmode" value="opaque" />
</object>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nothis.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nothis.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nothis.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nothis.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nothis.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nothis.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nothis.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nothis.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=6&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nothis.wordpress.com/2010/04/25/msjs-programming-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27b5e1bd848a50f92f8dad6839c59671?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmwlff</media:title>
		</media:content>
	</item>
		<item>
		<title>Knuckly interfaces</title>
		<link>http://nothis.wordpress.com/2010/04/25/knuckly-interfaces/</link>
		<comments>http://nothis.wordpress.com/2010/04/25/knuckly-interfaces/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:56:00 +0000</pubDate>
		<dc:creator>dmwlff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nothis.wordpress.com/2010/04/25/knuckly-interfaces</guid>
		<description><![CDATA[I loved <a href="http://twitter.com/cluttermouth">Marcus Phillips</a>' <a href="http://closureka.com/2010/04/18/speaking-at-this-months-sfjs-meetup">talk at the san francisco javascript meetup</a> on Friday. He's got a great presentation style and he clearly knows his stuff. <a href="http://nothis.wordpress.com/2010/04/25/knuckly-interfaces/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=7&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I loved <a href="http://twitter.com/cluttermouth">Marcus Phillips</a>&#8216; <a href="http://closureka.com/2010/04/18/speaking-at-this-months-sfjs-meetup">talk at the san francisco javascript meetup</a> on Friday. He&#8217;s got a great presentation style and he clearly knows his stuff.</p>
<p>In this case, that stuff was the implementation of OOP patterns in javascript, and he distinguished among the competing inheritance styles, arguing for <a href="http://www.bolinfest.com/javascript/inheritance.php">&#8220;functional inheritance&#8221;</a>. I hadn&#8217;t heard that name for that pattern before, but I did wonder: with a name so close to <a href="http://en.wikipedia.org/wiki/Functional_programming">a whole different programming paradigm</a>, why not just take the leap over to the dark side? When I asked Marcus about this, he voiced his support for <a href="http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)">encapsulation</a>. <a href="http://elasticprocess.com/content/groupthink">I&#8217;ve been critical of OOP for a long time</a>, but Marcus&#8217; talk made me think about why.<br />
<a name="more"></a><br />
In the realm of human interactions, I prefer the warm, if moist, hand slap over the apocalypto-hygenic fist bump. But with computer programming, I try to keep the interfaces knuckly. I think we&#8217;ve been trained to think of the interfaces in classical OOP systems, like Java, as hygienic and loosely coupled, since they distinguish between publicly accessible state and private. But stepping back, the core OOP coupling, the coupling between data and methods, actually causes a lot of problems.</p>
<p>The first problem that encapsulation causes is inheritance. Many of us think of inheritance as a feature, but I think we need to ask ourselves: what do we get from inheritance? How often do we really encounter the &#8220;perfect-subset&#8221; relation in a domain model? It&#8217;s rare. I think that this kind of relation is actually a by-product of years of reliance of SQL data stores, where data can <em>only</em> be modeled as a set. If you&#8217;re using a document data store, you get used to thinking more in terms of capabilities than classifications.</p>
<p>Encapsulation causes problems around serialization and transportability. The private nature of some state in the OOP pattern is precisely what makes them so hard to scale. The flip side of this is that OOP is a good pattern for exposing shared mutable state. While there&#8217;s this movement afoot towards actors , I, for one, think that some abstractions are still best modeled in OOP terms, like global queues and hash tables. But I think there&#8217;s a consensus building that these kinds of objects are the exception, and not the rule. Where possible, components should not encapsulate <em>any</em> state.</p>
<p>Going back to the example that Marcus gives, with his preferred &#8220;functional inheritance&#8221; pattern:</p>
<pre class="code">
// parent class maker function
var animal = function (location){
  var result = {'location' : location};
  result.move = function (){
    this.location += 1;
  };
  return result;
};

// child class maker function
var person = function (location, carSpeed){
  var result = animal(location);
  result.carSpeed = carSpeed;
  result.drive = function (){
    this.location += carSpeed;
  };
  return result;
};</pre>
<p>Recast in functional terms, we simply extract the state variables:</p>
<pre class="code">var benji = {'location' : POUND};
var carolyn = {'location' : DOWNTOWN, 'speed': FAST};

var move = function (animal){
    animal.location += 1;
}
var drive = function (person){
    person.location += person.speed;
}

move(benji);
drive(carolyn);</pre>
<p>At this point the type-safety types (I see you Python people) complain about what happens in the functional paradigm if we pass in invalid data:</p>
<pre class="code">//functional style
//data-loss error!
drive(benji);</pre>
<p>It&#8217;s true that this slightly worse than the corresponding error if we employ encapsulation:</p>
<pre class="code">//OOP style
//NPE!
benji.drive();</pre>
<p>Of course, the functional version of &#8220;drive&#8221; could always be written to validate its inputs. And in general, it seems like we could use better tools for schema contracts in javascript. But the bigger question is: how often does data cross these kinds of API boundaries, where the input data types are unchecked and unknown?</p>
<p>I would venture that we can sidestep these issues in functional systems, since they can be much more strict about the allowed couplings. In an OOP interface, any public method can call any other. But in <a href="http://openmsjs.org/">msjs</a>, for instance, functional dependencies are fixed at construction time. This makes it easy to track the impact of a change to the kind of data emitted by a given a function.</p>
<p>And the advantages of this approach are tremendous. The main benefit is that the entire system state is cacheable, since there&#8217;s no private data. I keep finding that, in the places where I used OOP, a functional approach makes for simpler, more portable code that performs better.</p>
<p>There&#8217;s a place for OOP, but for the average programmer building generic application and UI logic, I think it&#8217;s overkill.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nothis.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nothis.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nothis.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nothis.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nothis.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nothis.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nothis.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nothis.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=7&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nothis.wordpress.com/2010/04/25/knuckly-interfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27b5e1bd848a50f92f8dad6839c59671?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmwlff</media:title>
		</media:content>
	</item>
		<item>
		<title>The importance of bikeshedding</title>
		<link>http://nothis.wordpress.com/2010/04/25/the-importance-of-bikeshedding/</link>
		<comments>http://nothis.wordpress.com/2010/04/25/the-importance-of-bikeshedding/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 03:39:00 +0000</pubDate>
		<dc:creator>dmwlff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nothis.wordpress.com/2010/04/25/the-importance-of-bikeshedding</guid>
		<description><![CDATA[I really like what&#8217;s going on with CommonJS. I love how an ad-hoc standards group has formed around a real integration problem. But I&#8217;m embarrassed to say that I haven&#8217;t been following it. Until now, I haven&#8217;t been worried about &#8230; <a href="http://nothis.wordpress.com/2010/04/25/the-importance-of-bikeshedding/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=8&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I really like what&#8217;s going on with <a href="http://commonjs.org/">CommonJS</a>. I love how an ad-hoc standards group has formed around a real integration problem. But I&#8217;m embarrassed to say that I haven&#8217;t been following it. Until now, I haven&#8217;t been worried about interoperability. But now I really want to port <a href="http://openmsjs.org/">msjs</a> to <a href="http://nodejs.org/">node.js</a>, and I&#8217;m paying attention.</p>
<p>I&#8217;m similarly embarrassed to say that before reading <a href="http://groups.google.com/group/commonjs/browse_thread/thread/11c6f25c46b3837b/c208f92d98c4f72c">this thread</a>, I wasn&#8217;t familiar with the use of &#8220;bikeshedding&#8221; as a gloss on <a href="http://en.wikipedia.org/wiki/Parkinson%27s_Law_of_Triviality">Parkinson&#8217;s Law of Triviality</a>. But while I really like the formulation, I&#8217;m concerned about the way it can be used as rhetorical device to dismiss valid concerns about the semantics of an API.</p>
<p>I suppose I&#8217;m in <a href="http://www.ultrasaurus.com/sarahblog/2003/10/language-is-the-vehicle-of-thought/">the Sarah Allen camp</a> on this: language shapes thought. I think the name &#8220;<span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;">exports</span>&#8220;, which begat &#8220;<span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;">module</span>&#8221; was a wrong turn. To me, it makes more sense for the other side of the &#8220;<span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;">require</span>&#8221; API to be a corresponding function.</span></p>
<p>I like &#8220;<span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;">publish</span>&#8221; for this. I propose this kind of implementation (minus locking)</p>
<pre class="code">var runModule = ...//implementation dependent
var bindings = {};
var require = function(moduleName){
    //circular dependency check
    if (bindings[moduleName] == UNPUBLISHED) throw ...;

    //Run script if no binding for module
    if (bindings[moduleName] === void 0){
        bindings[moduleName] = UNPUBLISHED;
        try {
            var moduleScope = {
                require : require,
                publish: function(value){

                    //error to publish twice in same module
                    if (bindings[moduleName] != UNPUBLISHED){
                        throw ...;
                    }
                    bindings[moduleName] = value;
                }
            }
            runModule(moduleName, moduleScope);
        } finally{
            if (bindings[moduleName] == UNPUBLISHED) {
                //OK, module didn't publish anything.
                //It will run again.
                delete bindings[moduleName];
            }
        }
    }

    return bindings[moduleName];
}
</pre>
<p>I guess I&#8217;m also psyched about the new bike shed, but I do care what color it is.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nothis.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nothis.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nothis.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nothis.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nothis.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nothis.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nothis.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nothis.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=8&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nothis.wordpress.com/2010/04/25/the-importance-of-bikeshedding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27b5e1bd848a50f92f8dad6839c59671?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmwlff</media:title>
		</media:content>
	</item>
		<item>
		<title>Foreign languages</title>
		<link>http://nothis.wordpress.com/2010/04/24/foreign-languages/</link>
		<comments>http://nothis.wordpress.com/2010/04/24/foreign-languages/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 16:11:00 +0000</pubDate>
		<dc:creator>dmwlff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nothis.wordpress.com/2010/04/24/foreign-languages</guid>
		<description><![CDATA[I saw a nice presentation from @brmichel at the San Francisco js meetup last night. His talk was entitled &#8220;Not JavaScript&#8221; and pitched the benefits of the Objective-J language over javascript. Objective-J has been around for a while, but it &#8230; <a href="http://nothis.wordpress.com/2010/04/24/foreign-languages/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=10&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="font-family:Helvetica, Arial, sans-serif;font-size:13px;line-height:17px;"></span><br /><span class="Apple-style-span" style="font-family:Helvetica, Arial, sans-serif;font-size:13px;line-height:17px;">
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">I saw a nice presentation from <a class="external-link" href="http://twitter.com/brmichel" style="color:#003366;">@brmichel</a> at the San Francisco js meetup last night. His talk was entitled <a class="external-link" href="http://bit.ly/not-js" style="color:#003366;">&#8220;Not JavaScript&#8221;</a> and pitched the benefits of the <a class="external-link" href="http://cappuccino.org/" style="color:#003366;">Objective-J</a> language over javascript. Objective-J has been around for a while, but it seems like there&#8217;s a small resurgence in interest in compiling alternative languages into JavaScript. For the purposes of this post, I&#8217;m not talking about projects like <a class="external-link" href="http://pyjs.org/" style="color:#003366;">pyjamas</a> and <a class="external-link" href="http://code.google.com/webtoolkit/" style="color:#003366;">GWT</a> that compile exsiting languages into javascript, but new languages that were invented to solve some of the problems in javascript.</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;"></div>
<p><a name='more'></a>It seems like there&#8217;s this new wave of projects like Objective-J, <a class="external-link" href="http://jashkenas.github.com/coffee-script/" style="color:#003366;">coffeescript</a>, and <a class="external-link" href="http://www.asana.com/luna" style="color:#003366;">lunascript</a> which try to right some of the wrongs of js by inventing new syntax. I have to say that I&#8217;m down on this approach, thanks to the hard knocks I took at <a class="external-link" href="http://laszlosystems.com/" style="color:#003366;">Laszlo Systems</a> working on a Flex-like language for building rich internet apps called <a class="external-link" href="http://openlaszlo.org/" style="color:#003366;">OpenLaszlo</a>. Convincing developers to learn something new is difficult, and the further down the stack you go, the harder it is. Getting someone to adopt a new framework means making them read docs and learn new design patters, but getting them to adopt a new language means using new tools and learning new core semantics. I think that this is just too far to go for most developers, especially when there are solutions like Ruby on Rails that may not be perfect, but are good enough for government work.
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">I suppose you could make the argument that you can forget about developer adoption – if your new language is good for your internal productivity, then it&#8217;s good. But I would still question whether inventing a new language is the right place to attack most of these problems. I think that when people set off to develop a new language, it&#8217;s fun yak-shaving adventure, and it seems like it&#8217;ll only take a couple of months. What&#8217;s hard to see at the outset is how much infrastructure a programming language requires, even if it&#8217;s only used internally. Sure, the core developers at a company all use emacs and vim, but eventually you&#8217;ll hire someone who needs an IDE. Then you&#8217;ll also need docs, and building doc tools may be the hardest part of designing a language. You&#8217;ll need your own debugger, and at some point, you&#8217;ll also need to fix most of the leaky abstractions, where a single line of code compiles into some horribly performing worst-case in the compiled code, because we all know that if it&#8217;s possible, someone will do it.</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">But by far the worst thing about new languages is the lack of components. It always killed me to tell Laszlo users that they couldn&#8217;t really take advantage of the relatively large marketplace for Flash components, and that, later, we couldn&#8217;t leverage all the work that the Flex team did in creating their widget set. This was hearsay, but I believe it: the crew writing the Flex components was much bigger than the core team. It makes sense: a few super-geeks can spec, develop, and maintain a well-tested and relatively bug-free compiler and minimal tool chain, but it takes an army to get the UI details of things like comboboxes and grids right. These components have two audiences – the end users, who expect them to be performant and intuitive, and the developers who expect them to have consistent, natural, and thin APIs. Of course, you can invent bridges between the new language and the old one (GWT has a hilarious <a class="external-link" href="http://googlewebtoolkit.blogspot.com/2008/07/getting-to-really-know-gwt-part-1-jsni.html" style="color:#003366;">&#8220;native code&#8221; feature</a> that lets you write inline javascript) but if you do enough of that, what&#8217;s the point of your fancy new language?</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">The ironic thing to me is that javascript is one of the most meta-programmable languages out there. You can extend the native types for crying out loud! With the exception of a few advanced features like <a class="external-link" href="http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node252.html" style="color:#003366;">destructuring bind</a>, most of the good stuff can be implemented right in javascript. Every time I run <a class="external-link" href="http://code.google.com/p/jsdoc-toolkit/" style="color:#003366;">jsdoc toolkit</a> or use a Java library class, I&#8217;m glad to be working with standard languages that have mature tool chains.</div>
<p></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nothis.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nothis.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nothis.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nothis.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nothis.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nothis.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nothis.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nothis.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=10&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nothis.wordpress.com/2010/04/24/foreign-languages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27b5e1bd848a50f92f8dad6839c59671?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmwlff</media:title>
		</media:content>
	</item>
		<item>
		<title>Not &#8220;new&#8221;</title>
		<link>http://nothis.wordpress.com/2010/04/24/not-new/</link>
		<comments>http://nothis.wordpress.com/2010/04/24/not-new/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 15:59:00 +0000</pubDate>
		<dc:creator>dmwlff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nothis.wordpress.com/2010/04/24/not-new</guid>
		<description><![CDATA[This article from the Facebook engineering team captured a lot of what I&#8217;ve been saying about an emerging new way of building scalable systems for the web. I&#8217;ve been drawing a little table like this: Old New Relational DBs Document &#8230; <a href="http://nothis.wordpress.com/2010/04/24/not-new/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=9&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div><span class="Apple-style-span" style="font-family:Helvetica, Arial, sans-serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;line-height:17px;"><span class="Apple-style-span" style="font-size:13px;"></span></span></span><br /><span class="Apple-style-span" style="font-family:Helvetica, Arial, sans-serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;line-height:17px;"><span class="Apple-style-span" style="font-size:13px;"></span></span></span><br /><span class="Apple-style-span" style="font-family:Helvetica, Arial, sans-serif;font-size:100%;"><span class="Apple-style-span" style="font-size:13px;line-height:17px;"><span class="Apple-style-span" style="font-size:13px;">
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;"><a class="external-link" href="http://www.facebook.com/note.php?note_id=379717628919" style="color:#003366;">This article</a> from the Facebook engineering team captured a lot of what I&#8217;ve been saying about an emerging new way of building scalable systems for the web. I&#8217;ve been drawing a little table like this:</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;"></div>
<table class="confluenceTable" style="border-collapse:collapse;clear:left;color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:5px 0;padding:0;">
<tbody>
<tr style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;">
<th class="confluenceTh">Old</th>
<th class="confluenceTh">New</th>
</tr>
<tr style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;">
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Relational DBs</td>
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Document DBs</td>
</tr>
<tr style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;">
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">IDs</td>
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">UUIDs</td>
</tr>
<tr style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;">
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Indexing</td>
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Map/Reduce</td>
</tr>
<tr style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;">
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Function calls</td>
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Message passing</td>
</tr>
<tr style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;">
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Shared, mutable data</td>
<td class="confluenceTd" style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;vertical-align:top;border-color:rgb(221,221,221);border-style:solid;border-width:1px;padding:5px;">Immutable data</td>
</tr>
</tbody>
</table>
<p><a name='more'></a>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">It&#8217;s reductive to say that this new style is (a return to) functional programming, but it&#8217;s not far from the truth. It feels like we&#8217;re hitting the limits of OOP, and we&#8217;re headed towards a world of smaller, less consistent data processing components. Instead of acquiring, for instance, The Object That Represents The Message Queue, we acquire the functions that submit messages and accept message handlers. In so doing, we side-step issues of global state and synchronization.</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">The poster-children of this new style are functional programming languages like <a class="external-link" href="http://www.erlang.org/" style="color:#003366;">Erlang</a> and <a class="external-link" href="http://www.scala-lang.org/" style="color:#003366;">scala</a>, But the strictly functional style is very hard for the average programmer &#8212; it&#8217;s more than just a <em>different</em> way of thinking &#8212; it&#8217;s a more rigorous, <em>harder</em> way of thinking. I&#8217;m sure the OCaml honks out there think that functional programming is easy as falling off a log, but try explaining what a <a class="external-link" href="http://en.wikipedia.org/wiki/Monad_(functional_programming)" style="color:#003366;">monad</a> is to your average getter/setter writer. Furthermore, some of these approaches just take the immutability thing a little too far. When you&#8217;re working on a DOM, or working with a message buffer, a little state can go a long way.</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">msjs uses what I call a &#8220;relaxed functional style,&#8221; to borrow an attitude from the excellent <a class="external-link" href="http://couchdb.apache.org/" style="color:#003366;">CouchDB project</a>. msjs programs are built as a series of functions and their dependencies, but just as a way of passing messages between the relatively stateful <a class="external-link" href="http://openmsjs.org/wiki/display/msjs/Using+jQuery" style="color:#003366;">world of the browser DOM</a> on one side, and <a class="external-link" href="http://openmsjs.org/wiki/display/msjs/Using+Java" style="color:#003366;">the world of the JVM</a> on the other. Say what you will about Java, but it&#8217;s got <a class="external-link" href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/package-summary.html" style="color:#003366;">the best libraries for shared mutable data</a>.</div>
<div style="color:black;font-size:10pt;font-weight:normal;line-height:13pt;margin:10px 0;padding:0;">javascript is already a great glue language. It&#8217;s highly embeddable and nearly ubiquitous, and JSON is quickly becoming the preferred data interchange format. But the best thing about it is that it supports an intuitive functional programming style.</div>
<p></span></span></span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nothis.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nothis.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nothis.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nothis.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nothis.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nothis.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nothis.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nothis.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nothis.wordpress.com&amp;blog=13473429&amp;post=9&amp;subd=nothis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nothis.wordpress.com/2010/04/24/not-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27b5e1bd848a50f92f8dad6839c59671?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmwlff</media:title>
		</media:content>
	</item>
	</channel>
</rss>
