<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: On Language Design: Making Expensive Actions Hard</title>
	<atom:link href="http://zef.me/2805/on-language-design-making-expensive-actions-hard/feed" rel="self" type="application/rss+xml" />
	<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard</link>
	<description>Technology, Me, You.</description>
	<lastBuildDate>Mon, 06 Sep 2010 22:06:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: CJM</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3715</link>
		<dc:creator>CJM</dc:creator>
		<pubDate>Sat, 27 Feb 2010 07:59:23 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3715</guid>
		<description>&lt;p&gt;I have to admit, I don&#039;t buy it.  You&#039;re no longer abstracting the calls and you&#039;ll have a hell of a time changing your code if you want to swap out the upstream implementation (what if your persistence provider is in memory?).  All I want to do semantically is read a property (why should I create a transaction when no writing is involved anyways?).  &lt;br&gt;&lt;br&gt;One of the great things about abstraction is that you have reduced duplication of code.  Your solution fails at this and requires nearly identical callbacks and transactions and whatnot to be created every time you want to do something (if you continue down this path, it makes sense not to factor the transaction block into its own function, because that would be hiding its real cost to consumers).  Another great thing about abstraction is that it makes it possible to improve and change the implementation (and correct defects in it) without needing to modify the consumers.  Actually creating all of the objects manually in sequence is well and good (and  efficient, sure), but it doesn&#039;t exactly lead to code that can be maintained easily.&lt;br&gt;&lt;br&gt;It seems to me that your solution is essentially &#039;make the programmer type more so that they get the idea that something is expensive&#039;.  The example that you provided is not necessarily expensive - you yourself mentioned that you could set up prefetching which would make the operation cheap.  On different platforms, even without prefetching, the operation isn&#039;t necessarily that expensive.  For that matter, what do you even mean by expensive (storage, processor cycles, end-to-end time, shared locks) - I&#039;m guessing in terms of time?  Even in the cases where it is always expensive, how is your solution better than creating functions with long names like &#039;getFatherOfObjectPleaseNoteThisTakesALittleWhileButNotQuiteAsLongAsFunctionX&#039; to represent the functions that take longer?  If you want approximate time cost information to be available, add it as metadata to the function if your language of choice supports it (eg [ApproximateFunctionTimeCostAttribute(ApproximatedCost.Expensive)]), or tell your developers to test their code (does it run acceptably fast? okay!), or tell them to use a profiler.  Making complex or slow functions difficult to call isn&#039;t a way to program more efficiently, it&#039;s a way to irritate developers and design poor APIs.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I have to admit, I don&#39;t buy it.  You&#39;re no longer abstracting the calls and you&#39;ll have a hell of a time changing your code if you want to swap out the upstream implementation (what if your persistence provider is in memory?).  All I want to do semantically is read a property (why should I create a transaction when no writing is involved anyways?).  <br /><br />One of the great things about abstraction is that you have reduced duplication of code.  Your solution fails at this and requires nearly identical callbacks and transactions and whatnot to be created every time you want to do something (if you continue down this path, it makes sense not to factor the transaction block into its own function, because that would be hiding its real cost to consumers).  Another great thing about abstraction is that it makes it possible to improve and change the implementation (and correct defects in it) without needing to modify the consumers.  Actually creating all of the objects manually in sequence is well and good (and  efficient, sure), but it doesn&#39;t exactly lead to code that can be maintained easily.<br /><br />It seems to me that your solution is essentially &#39;make the programmer type more so that they get the idea that something is expensive&#39;.  The example that you provided is not necessarily expensive &#8211; you yourself mentioned that you could set up prefetching which would make the operation cheap.  On different platforms, even without prefetching, the operation isn&#39;t necessarily that expensive.  For that matter, what do you even mean by expensive (storage, processor cycles, end-to-end time, shared locks) &#8211; I&#39;m guessing in terms of time?  Even in the cases where it is always expensive, how is your solution better than creating functions with long names like &#39;getFatherOfObjectPleaseNoteThisTakesALittleWhileButNotQuiteAsLongAsFunctionX&#39; to represent the functions that take longer?  If you want approximate time cost information to be available, add it as metadata to the function if your language of choice supports it (eg [ApproximateFunctionTimeCostAttribute(ApproximatedCost.Expensive)]), or tell your developers to test their code (does it run acceptably fast? okay!), or tell them to use a profiler.  Making complex or slow functions difficult to call isn&#39;t a way to program more efficiently, it&#39;s a way to irritate developers and design poor APIs.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Zef Hemel</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3672</link>
		<dc:creator>Zef Hemel</dc:creator>
		<pubDate>Fri, 12 Feb 2010 20:39:54 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3672</guid>
		<description>&lt;p&gt;&gt; That&#039;s true, but the reason - abstraction - is valuable!&lt;br&gt;&lt;br&gt;Abstraction is very valuable, but this is an example of a leaky abstraction. You &lt;em&gt;think&lt;/em&gt; you&#039;re just doing a cheap getter call, but in fact it is really expensive. But of course, it&#039;s a trade off.&lt;br&gt;&lt;br&gt;&gt; Can you use those objects in the same ways as you could the equivalent Java objects (ie adding behaviour to the object)? Is their &quot;life&quot; limited to the duration of the async anonymous function, or could they, for example, be dumped in a queue for later use?&lt;br&gt;&lt;br&gt;Absolutely, they&#039;re just regular objects, like Java objects. You can do with them whatever you like. Because of Javascripts extreme dynamic nature you can add any behavior to the object you like.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&gt; That&#39;s true, but the reason &#8211; abstraction &#8211; is valuable!<br /><br />Abstraction is very valuable, but this is an example of a leaky abstraction. You <em>think</em> you&#39;re just doing a cheap getter call, but in fact it is really expensive. But of course, it&#39;s a trade off.<br /><br />&gt; Can you use those objects in the same ways as you could the equivalent Java objects (ie adding behaviour to the object)? Is their &#8220;life&#8221; limited to the duration of the async anonymous function, or could they, for example, be dumped in a queue for later use?<br /><br />Absolutely, they&#39;re just regular objects, like Java objects. You can do with them whatever you like. Because of Javascripts extreme dynamic nature you can add any behavior to the object you like.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: HolyHaddock</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3671</link>
		<dc:creator>HolyHaddock</dc:creator>
		<pubDate>Fri, 12 Feb 2010 20:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3671</guid>
		<description>&lt;p&gt;&gt; In Java, it is difficult to predict which statements are going to be expensive to execute by inspecting the code.&lt;br&gt;&lt;br&gt;That&#039;s true, but the reason - abstraction - is valuable! Relating your example to The Day Job, I can perform that ORM call deep in a data layer somewhere, pass the Person object for display - and when writing the UI code, I (or another person, or another team) writing the code don&#039;t have to know that there is a data layer. In your example, doesn&#039;t the data layer either need to know when the UI layer will need the parent, or the UI layer have to know about the fetch function from the data layer?&lt;br&gt;&lt;br&gt;I don&#039;t really know Javascript, so the rest of this post is very interesting. I like that having taken that design decision, what would be incredibly verbose and impossible in Java is reasonably straightforward here. Can you use those objects in the same ways as you could the equivalent Java objects (ie adding behaviour to the object)? Is their &quot;life&quot; limited to the duration of the async anonymous function, or could they, for example, be dumped in a queue for later use?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&gt; In Java, it is difficult to predict which statements are going to be expensive to execute by inspecting the code.<br /><br />That&#39;s true, but the reason &#8211; abstraction &#8211; is valuable! Relating your example to The Day Job, I can perform that ORM call deep in a data layer somewhere, pass the Person object for display &#8211; and when writing the UI code, I (or another person, or another team) writing the code don&#39;t have to know that there is a data layer. In your example, doesn&#39;t the data layer either need to know when the UI layer will need the parent, or the UI layer have to know about the fetch function from the data layer?<br /><br />I don&#39;t really know Javascript, so the rest of this post is very interesting. I like that having taken that design decision, what would be incredibly verbose and impossible in Java is reasonably straightforward here. Can you use those objects in the same ways as you could the equivalent Java objects (ie adding behaviour to the object)? Is their &#8220;life&#8221; limited to the duration of the async anonymous function, or could they, for example, be dumped in a queue for later use?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Zef Hemel</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3670</link>
		<dc:creator>Zef Hemel</dc:creator>
		<pubDate>Fri, 12 Feb 2010 13:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3670</guid>
		<description>&lt;p&gt;Right, that&#039;s exactly the kind of thing you want to avoid.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Right, that&#39;s exactly the kind of thing you want to avoid.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rickard Andersson</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3669</link>
		<dc:creator>Rickard Andersson</dc:creator>
		<pubDate>Fri, 12 Feb 2010 13:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3669</guid>
		<description>&lt;p&gt;I met someone from Sony Ericsson a while back and he told me about an issue they had with the address book in certain cell phone models. Scrolling through the list was very slow. Someone took a good look at it and it turns out, for every step you scrolled through the address book, about 60 queries were executed.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I met someone from Sony Ericsson a while back and he told me about an issue they had with the address book in certain cell phone models. Scrolling through the list was very slow. Someone took a good look at it and it turns out, for every step you scrolled through the address book, about 60 queries were executed.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Zef Hemel</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3667</link>
		<dc:creator>Zef Hemel</dc:creator>
		<pubDate>Thu, 11 Feb 2010 01:25:55 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3667</guid>
		<description>&lt;p&gt;Thanks for that.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for that.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: reddit</title>
		<link>http://zef.me/2805/on-language-design-making-expensive-actions-hard/comment-page-1#comment-3666</link>
		<dc:creator>reddit</dc:creator>
		<pubDate>Thu, 11 Feb 2010 01:18:46 +0000</pubDate>
		<guid isPermaLink="false">http://zef.me/?p=2805#comment-3666</guid>
		<description>&lt;p&gt;TLDR;  I don&#039;t have implemented lazy fetching, &lt;em&gt;but&lt;/em&gt; it&#039;s to prevent stupidness, look mum I&#039;ve done an ORM!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>TLDR;  I don&#39;t have implemented lazy fetching, <em>but</em> it&#39;s to prevent stupidness, look mum I&#39;ve done an ORM!</p>]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->