<?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: Is Functional Abstraction Too Clever?</title>
	<atom:link href="http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/</link>
	<description>Git, .NET and more</description>
	<lastBuildDate>Mon, 01 Apr 2013 17:24:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Alexander Abramov</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-24</link>
		<dc:creator>Alexander Abramov</dc:creator>
		<pubDate>Fri, 30 Oct 2009 19:11:58 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-24</guid>
		<description>Nice post and comments, functional style needs to be brought to broader audience. It is is just a tool with its own uses, and a very expressive tool at that.</description>
		<content:encoded><![CDATA[<p>Nice post and comments, functional style needs to be brought to broader audience. It is is just a tool with its own uses, and a very expressive tool at that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Dahlby</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-23</link>
		<dc:creator>Keith Dahlby</dc:creator>
		<pubDate>Mon, 19 Oct 2009 16:27:01 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-23</guid>
		<description>@Chris ~

You&#039;re right except that after Append() we&#039;re sorting the full sequence so the 0 will end up first anyway - a slightly more optimized (but maybe less readable?) version would sort the random values first and then prepend/append as you said:

                       .Take(slots - 1)
                      .OrderBy(i =&gt; i)
                      .Prepend(0).Append(max)
                      ...</description>
		<content:encoded><![CDATA[<p>@Chris ~</p>
<p>You&#8217;re right except that after Append() we&#8217;re sorting the full sequence so the 0 will end up first anyway &#8211; a slightly more optimized (but maybe less readable?) version would sort the random values first and then prepend/append as you said:</p>
<p>                       .Take(slots &#8211; 1)<br />
                      .OrderBy(i => i)<br />
                      .Prepend(0).Append(max)<br />
                      &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Falter</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-22</link>
		<dc:creator>Chris Falter</dc:creator>
		<pubDate>Mon, 19 Oct 2009 15:45:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-22</guid>
		<description>Looks like there&#039;s a bug in calling Append(0, max)?  Based on the implementation of Append, it likes like it concatenates 0 and max as the last 2 members of the list.  That&#039;s what IEnumerable&lt;TSource&gt;(IEnumerable first, IEnumerable second) does--in your case, &quot;0, max&quot; being the IEnumerable second.

Instead, I think you would have to do the following:

.Prepend(0)
.Append(max)
// etc.

Other than that minor bug, I love the idea and the code.  Excellent post!
</description>
		<content:encoded><![CDATA[<p>Looks like there&#8217;s a bug in calling Append(0, max)?  Based on the implementation of Append, it likes like it concatenates 0 and max as the last 2 members of the list.  That&#8217;s what IEnumerable<tsource>(IEnumerable first, IEnumerable second) does&#8211;in your case, &#8220;0, max&#8221; being the IEnumerable second.</p>
<p>Instead, I think you would have to do the following:</p>
<p>.Prepend(0)<br />
.Append(max)<br />
// etc.</p>
<p>Other than that minor bug, I love the idea and the code.  Excellent post!<br />
</tsource></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-21</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Mon, 19 Oct 2009 03:57:23 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-21</guid>
		<description>@Keith - For what it&#039;s worth, I double-checked Random.Next&#039;s behavior just now and I was in fact having a brain fart earlier today. Your impl is both clear in intent and clear of bugs. :)</description>
		<content:encoded><![CDATA[<p>@Keith &#8211; For what it&#8217;s worth, I double-checked Random.Next&#8217;s behavior just now and I was in fact having a brain fart earlier today. Your impl is both clear in intent and clear of bugs. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Morton </title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-20</link>
		<dc:creator>David Morton </dc:creator>
		<pubDate>Sun, 18 Oct 2009 01:46:51 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-20</guid>
		<description>Check the StackOverflow link.  I&#039;ve posted another possible solution that seems to work for the purposes, and still seems to be relatively fast.  It&#039;s certainly inspired by the code on this post, however, but I&#039;ve chosen instead to use a dictionary instead of creating a whole pairwise method, though Pairwise isn&#039;t a bad idea.  </description>
		<content:encoded><![CDATA[<p>Check the StackOverflow link.  I&#8217;ve posted another possible solution that seems to work for the purposes, and still seems to be relatively fast.  It&#8217;s certainly inspired by the code on this post, however, but I&#8217;ve chosen instead to use a dictionary instead of creating a whole pairwise method, though Pairwise isn&#8217;t a bad idea.  </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Dahlby</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-19</link>
		<dc:creator>Keith Dahlby</dc:creator>
		<pubDate>Sat, 17 Oct 2009 19:54:30 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-19</guid>
		<description>@Paul ~ There really isn&#039;t a clean way to represent Pairwise with the standard operators - the F# implementation is imperative as well.

@Adam ~ I don&#039;t think corporate environments care about the language used, per se. They care about support and availability of developers. Until MS can prove that F# is ready for the big time (they&#039;re trying) and there are more than a token number of developers that really know F#, I don&#039;t see that happening. Eventually we&#039;ll get there, but in the meantime I would advocate all developers learning how to apply functional concepts in their current language of choice to ease the transition if/when that day comes.

@Jeremy ~ I don&#039;t believe in bugs, only undocumented features. ;) My intent with Values is to provide an infinite sequence generated with Next(min,max), with terminating the sequence delegated to Take(While). I think it needs a better name than Values, but I can&#039;t think of one that I like.

@All ~ I figured the perceived cleverness was due to its non-imperativeness, but sometimes it&#039;s hard to be objective about solutions that I rather like. Thanks for the feedback!</description>
		<content:encoded><![CDATA[<p>@Paul ~ There really isn&#8217;t a clean way to represent Pairwise with the standard operators &#8211; the F# implementation is imperative as well.</p>
<p>@Adam ~ I don&#8217;t think corporate environments care about the language used, per se. They care about support and availability of developers. Until MS can prove that F# is ready for the big time (they&#8217;re trying) and there are more than a token number of developers that really know F#, I don&#8217;t see that happening. Eventually we&#8217;ll get there, but in the meantime I would advocate all developers learning how to apply functional concepts in their current language of choice to ease the transition if/when that day comes.</p>
<p>@Jeremy ~ I don&#8217;t believe in bugs, only undocumented features. ;) My intent with Values is to provide an infinite sequence generated with Next(min,max), with terminating the sequence delegated to Take(While). I think it needs a better name than Values, but I can&#8217;t think of one that I like.</p>
<p>@All ~ I figured the perceived cleverness was due to its non-imperativeness, but sometimes it&#8217;s hard to be objective about solutions that I rather like. Thanks for the feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-18</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Sat, 17 Oct 2009 19:20:05 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-18</guid>
		<description>re: there being a bug - unless I&#039;m having a Complete Saturday Brainfart about the behaviour of the Values extension method, that is. ;)</description>
		<content:encoded><![CDATA[<p>re: there being a bug &#8211; unless I&#8217;m having a Complete Saturday Brainfart about the behaviour of the Values extension method, that is. ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-17</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Sat, 17 Oct 2009 18:59:56 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-17</guid>
		<description>This code is not too clever. In fact, it would be difficult to create a more direct representation of the stated requirements! The meaning of Pairwise might be the only part someone would find unfamiliar and even that part takes only a moment to understand.

Code one step too clever obscures intent (and bugs) as much as the old-school procedural style code that was accepted over your version. The goal is to find the sweet spot, which I think you&#039;ve done nicely.

Had that accepted implementation contained a bug, it would almost surely be lost in the noise and harder to spot than the small bug I very quickly spotted in yours. :D

The fact that I could spot it so quickly is, IMHO, a very good thing. Good code strives to make intent clear and bugs obvious.</description>
		<content:encoded><![CDATA[<p>This code is not too clever. In fact, it would be difficult to create a more direct representation of the stated requirements! The meaning of Pairwise might be the only part someone would find unfamiliar and even that part takes only a moment to understand.</p>
<p>Code one step too clever obscures intent (and bugs) as much as the old-school procedural style code that was accepted over your version. The goal is to find the sweet spot, which I think you&#8217;ve done nicely.</p>
<p>Had that accepted implementation contained a bug, it would almost surely be lost in the noise and harder to spot than the small bug I very quickly spotted in yours. :D</p>
<p>The fact that I could spot it so quickly is, IMHO, a very good thing. Good code strives to make intent clear and bugs obvious.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-16</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Sat, 17 Oct 2009 15:51:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-16</guid>
		<description>Nice post. I&#039;m not sure if all this functional programming stuff doesn&#039;t just boild down - in these examples on list processing - to a pipeline. I&#039;ve solved many problems of this kind with an OO pipepline of Mappers and Filters. 

Oh and I like functional programming.
Cheers
Stephan
http://www.codemonkeyism.com</description>
		<content:encoded><![CDATA[<p>Nice post. I&#8217;m not sure if all this functional programming stuff doesn&#8217;t just boild down &#8211; in these examples on list processing &#8211; to a pipeline. I&#8217;ve solved many problems of this kind with an OO pipepline of Mappers and Filters. </p>
<p>Oh and I like functional programming.<br />
Cheers<br />
Stephan<br />
<a href="http://www.codemonkeyism.com" rel="nofollow">http://www.codemonkeyism.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Wolf</title>
		<link>http://lostechies.com/keithdahlby/2009/10/17/is-functional-abstraction-too-clever/#comment-15</link>
		<dc:creator>Adam Wolf</dc:creator>
		<pubDate>Sat, 17 Oct 2009 15:36:56 +0000</pubDate>
		<guid isPermaLink="false">/blogs/dahlbyk/archive/2009/10/17/is-functional-abstraction-too-clever.aspx#comment-15</guid>
		<description>Too clever, No. This is a great example of how functional programming dissects problems and solves them. I can&#039;t imagine people who actually know how LINQ, Yield and extension methods would think this is too clever. 

The level of abstraction in the GetSlots method is perfect. I guess some people need to have everything in front of them to feel comfortable about the code but are willing to use the BCL without browsing the source.

Does F# have a chance in corporate  america?

</description>
		<content:encoded><![CDATA[<p>Too clever, No. This is a great example of how functional programming dissects problems and solves them. I can&#8217;t imagine people who actually know how LINQ, Yield and extension methods would think this is too clever. </p>
<p>The level of abstraction in the GetSlots method is perfect. I guess some people need to have everything in front of them to feel comfortable about the code but are willing to use the BCL without browsing the source.</p>
<p>Does F# have a chance in corporate  america?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
