<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Show me functional programming, I have no clue (obviously)</title>
	<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/</link>
	<description>Productivity in software development</description>
	<pubDate>Sun, 12 Oct 2008 17:46:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-139918</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 29 Jul 2008 19:44:08 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-139918</guid>
		<description>Ah. What insight.</description>
		<content:encoded><![CDATA[<p>Ah. What insight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mondragon</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-139686</link>
		<dc:creator>Mondragon</dc:creator>
		<pubDate>Tue, 29 Jul 2008 12:20:22 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-139686</guid>
		<description>Shut the fuck up and go back to yer cage, Java database code monkey.
Nuff said.</description>
		<content:encoded><![CDATA[<p>Shut the fuck up and go back to yer cage, Java database code monkey.<br />
Nuff said.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52544</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Fri, 01 Feb 2008 21:20:59 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52544</guid>
		<description>Oh, I've been using Groovy for years, and Grails since 0.1 I guess ;-) See some old posts on this blog (and perhaps some old posts on the IntelliJ forum with requests for Groovy support).</description>
		<content:encoded><![CDATA[<p>Oh, I&#8217;ve been using Groovy for years, and Grails since 0.1 I guess ;-) See some old posts on this blog (and perhaps some old posts on the IntelliJ forum with requests for Groovy support).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Iry</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52525</link>
		<dc:creator>James Iry</dc:creator>
		<pubDate>Fri, 01 Feb 2008 19:20:19 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52525</guid>
		<description>&#62; but gaining the functional power I lose hundreds of thousands of developers

Of course.  And when Java was new you could have said the same thing about it compared with C   - "by gaining cross platform dynamic linking, multi-threading, and garbage collection I'm losing developers."  There are trade-offs in being an early adopter.  I can't argue with that.

&#62; Not sure if { _.age &#62; 3 } is worth it compared to inner classes.

If that was all that Scala had then it wouldn't be worth considering.  Groovy has that and so much more in the form of dynamic metagprogramming and "builders" and the nullsafe dot operator and...

But Scala has unique things to offer of its own: higher kinded types, explicit self types, type inference, type members, existential types, etc.  If you like static typing, Scala brings OO type systems up to speed with some of the more powerful type systems out there.  It also has pattern matching, optional laziness, the aforementioned "for" which is crazy powerful and quite clean, etc, etc.

Now, I happen to like Scala, but I don't want to stifle your exploration into other languages.  Groovy is a very easy one to noodle around with and dip your toe into the interplay of functional and OO features and, as I said, dynamic metaprogramming changes the game substantially.

If you don't insist on staying on the JVM platform, F# is one of the few modern functional languages with the kind of IDE and other tooling experience that you've come to expect in Java land.  Scala and Groovy are both trying to catch up, but they don't have Microsoft $ behind them.</description>
		<content:encoded><![CDATA[<p>&gt; but gaining the functional power I lose hundreds of thousands of developers</p>
<p>Of course.  And when Java was new you could have said the same thing about it compared with C   - &#8220;by gaining cross platform dynamic linking, multi-threading, and garbage collection I&#8217;m losing developers.&#8221;  There are trade-offs in being an early adopter.  I can&#8217;t argue with that.</p>
<p>&gt; Not sure if { _.age &gt; 3 } is worth it compared to inner classes.</p>
<p>If that was all that Scala had then it wouldn&#8217;t be worth considering.  Groovy has that and so much more in the form of dynamic metagprogramming and &#8220;builders&#8221; and the nullsafe dot operator and&#8230;</p>
<p>But Scala has unique things to offer of its own: higher kinded types, explicit self types, type inference, type members, existential types, etc.  If you like static typing, Scala brings OO type systems up to speed with some of the more powerful type systems out there.  It also has pattern matching, optional laziness, the aforementioned &#8220;for&#8221; which is crazy powerful and quite clean, etc, etc.</p>
<p>Now, I happen to like Scala, but I don&#8217;t want to stifle your exploration into other languages.  Groovy is a very easy one to noodle around with and dip your toe into the interplay of functional and OO features and, as I said, dynamic metaprogramming changes the game substantially.</p>
<p>If you don&#8217;t insist on staying on the JVM platform, F# is one of the few modern functional languages with the kind of IDE and other tooling experience that you&#8217;ve come to expect in Java land.  Scala and Groovy are both trying to catch up, but they don&#8217;t have Microsoft $ behind them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52503</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Fri, 01 Feb 2008 17:03:58 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52503</guid>
		<description>Well I'm interested in Scala, and I might use it for development, but gaining the functional power I lose hundreds of thousands of developers (for an open source project) or dozens of developers (commercial project). Not sure if { _.age &gt; 3 } is worth it compared to inner classes.

Do you know a JVM language which resembles bla?</description>
		<content:encoded><![CDATA[<p>Well I&#8217;m interested in Scala, and I might use it for development, but gaining the functional power I lose hundreds of thousands of developers (for an open source project) or dozens of developers (commercial project). Not sure if { _.age > 3 } is worth it compared to inner classes.</p>
<p>Do you know a JVM language which resembles bla?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Iry</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52498</link>
		<dc:creator>James Iry</dc:creator>
		<pubDate>Fri, 01 Feb 2008 15:55:47 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52498</guid>
		<description>&#62; As written in the other thread, lots of my OO code is side effect free, immutable and
&#62; doesn’t come with state. In Java.

Good.  Then you'll love Scala because its core semantics are  basically Java's but it makes immutable, side effect free code much easier to write.  For instance, it's for loop isn't really a for loop and can used entirely side effect free - even without Iterator (instances of which must be stateful).

&#62; Won’t use, language design is hard, most definitely I’d screw up and the 
&#62; developers who need to maintain the code after I left would be screwed.

Then I can say that Lisp is not your language.  If you don't use macros then you'd be paying a syntactic price for an unused feature.  You'd be better off with other functional languages without syntactic abstraction or where the syntax hasn't been kept flat to support it.

&#62; Do I use map , filter, reduce, each? Mostly not, see the reasons we discussed
&#62; already. Most often that’s not needed. When it does make sense I use a
&#62; List persons = select(person, ageSelector);

I'm assuming that person is also a list.  In Scala you could write exactly that or write "person filter {_.age &#62; 3}"  The semantics of the later are in fact essentially the same as the former, you just don't need to write an anonymous class by hand.  In Scala,  this

persons = person filter {_.age &#62; 3}

Looks a lot like your "$it.age &#62; 3" code eh?  But it's shorthand for the Scala equivalent of this Java

List persons = person.filter(new Function1() {
   public Boolean apply(Person person) {
      return person.age &#62; 3;
   }
}

Nifty eh?  It's OO, it's FP.  It's both.  And that Java is the same as this Scala

persons:List = person.filter(new Function1[Person, Boolean]() {
   def apply(Person person):Boolean = {
      person.age &#62; 3;
   }
}

Pretty much like the Java version - just some minor syntactic variation e.g. symbol:type instead of type symbol, square brackets instead of angled brackets, and a keyword (def) for indicating the start of a method.  

So without changing semantics a bit, the Scala shorthand clears away the cruft of the anonymous class and reveals the core concept - finding people where the age &#62; 3.

&#62; I have the book for some years (thanks dostoyevsky ;-), it didn’t convince me
&#62; back then. But because you re-recommend it to help my enlightenment, I’ll take
&#62; another look.

It's a good book.  I also liked Graham's On Lisp (I know you're know PG fan, and I don't always agree with him, but the man really can write).

But I'm getting the impression that you equate Lisp with functional programming.  Common Lisp (and other lisps) are in the very broad functional family, but there are many interesting languages in that family.  I'm most familiar with Scheme, Haskell, and Scala - and of those, only one is a lisp.  Various ML's are popular in the functional crowd, especially OCaml - and F# is a variation on OCaml.  There are very researchy languages like Coq and Epigram.  

So if you don't like Lisp, that's fine.  You're missing out, IMHO, on something deeply beautiful there, but what you're missing out on is syntactic abstraction and a "code is data mindset" not functional programming.  

Functional programming can be done in languages with richer syntax and powerful static typing systems - you don't need to throw out the functional baby because you don't like the Lisp bathwater.  And if you like OO, then you don't need to abandon it either.</description>
		<content:encoded><![CDATA[<p>&gt; As written in the other thread, lots of my OO code is side effect free, immutable and<br />
&gt; doesn’t come with state. In Java.</p>
<p>Good.  Then you&#8217;ll love Scala because its core semantics are  basically Java&#8217;s but it makes immutable, side effect free code much easier to write.  For instance, it&#8217;s for loop isn&#8217;t really a for loop and can used entirely side effect free - even without Iterator (instances of which must be stateful).</p>
<p>&gt; Won’t use, language design is hard, most definitely I’d screw up and the<br />
&gt; developers who need to maintain the code after I left would be screwed.</p>
<p>Then I can say that Lisp is not your language.  If you don&#8217;t use macros then you&#8217;d be paying a syntactic price for an unused feature.  You&#8217;d be better off with other functional languages without syntactic abstraction or where the syntax hasn&#8217;t been kept flat to support it.</p>
<p>&gt; Do I use map , filter, reduce, each? Mostly not, see the reasons we discussed<br />
&gt; already. Most often that’s not needed. When it does make sense I use a<br />
&gt; List persons = select(person, ageSelector);</p>
<p>I&#8217;m assuming that person is also a list.  In Scala you could write exactly that or write &#8220;person filter {_.age &gt; 3}&#8221;  The semantics of the later are in fact essentially the same as the former, you just don&#8217;t need to write an anonymous class by hand.  In Scala,  this</p>
<p>persons = person filter {_.age &gt; 3}</p>
<p>Looks a lot like your &#8220;$it.age &gt; 3&#8243; code eh?  But it&#8217;s shorthand for the Scala equivalent of this Java</p>
<p>List persons = person.filter(new Function1() {<br />
   public Boolean apply(Person person) {<br />
      return person.age &gt; 3;<br />
   }<br />
}</p>
<p>Nifty eh?  It&#8217;s OO, it&#8217;s FP.  It&#8217;s both.  And that Java is the same as this Scala</p>
<p>persons:List = person.filter(new Function1[Person, Boolean]() {<br />
   def apply(Person person):Boolean = {<br />
      person.age &gt; 3;<br />
   }<br />
}</p>
<p>Pretty much like the Java version - just some minor syntactic variation e.g. symbol:type instead of type symbol, square brackets instead of angled brackets, and a keyword (def) for indicating the start of a method.  </p>
<p>So without changing semantics a bit, the Scala shorthand clears away the cruft of the anonymous class and reveals the core concept - finding people where the age &gt; 3.</p>
<p>&gt; I have the book for some years (thanks dostoyevsky ;-), it didn’t convince me<br />
&gt; back then. But because you re-recommend it to help my enlightenment, I’ll take<br />
&gt; another look.</p>
<p>It&#8217;s a good book.  I also liked Graham&#8217;s On Lisp (I know you&#8217;re know PG fan, and I don&#8217;t always agree with him, but the man really can write).</p>
<p>But I&#8217;m getting the impression that you equate Lisp with functional programming.  Common Lisp (and other lisps) are in the very broad functional family, but there are many interesting languages in that family.  I&#8217;m most familiar with Scheme, Haskell, and Scala - and of those, only one is a lisp.  Various ML&#8217;s are popular in the functional crowd, especially OCaml - and F# is a variation on OCaml.  There are very researchy languages like Coq and Epigram.  </p>
<p>So if you don&#8217;t like Lisp, that&#8217;s fine.  You&#8217;re missing out, IMHO, on something deeply beautiful there, but what you&#8217;re missing out on is syntactic abstraction and a &#8220;code is data mindset&#8221; not functional programming.  </p>
<p>Functional programming can be done in languages with richer syntax and powerful static typing systems - you don&#8217;t need to throw out the functional baby because you don&#8217;t like the Lisp bathwater.  And if you like OO, then you don&#8217;t need to abandon it either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52404</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Fri, 01 Feb 2008 05:37:44 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52404</guid>
		<description>"Let me turn this around, how would YOU write an enterprise app in language with both OO and functional features?"

As written in the other thread, lots of my OO code is side effect free, immutable and doesn't come with state. In Java.

"What if you had the ability to extend the language’s syntax with your own syntax? "

Won't use, language design is hard, most definitely I'd screw up and the developers who need to maintain the code after I left would be screwed.

Do I use map , filter, reduce, each? Mostly not, see the reasons we discussed already. Most often that's not needed. When it does make sense I use a 

List persons = select(person, ageSelector);

I have the book for some years (thanks dostoyevsky ;-), it didn't convince me back then. But because you re-recommend it to help my enlightenment, I'll take another look.</description>
		<content:encoded><![CDATA[<p>&#8220;Let me turn this around, how would YOU write an enterprise app in language with both OO and functional features?&#8221;</p>
<p>As written in the other thread, lots of my OO code is side effect free, immutable and doesn&#8217;t come with state. In Java.</p>
<p>&#8220;What if you had the ability to extend the language’s syntax with your own syntax? &#8221;</p>
<p>Won&#8217;t use, language design is hard, most definitely I&#8217;d screw up and the developers who need to maintain the code after I left would be screwed.</p>
<p>Do I use map , filter, reduce, each? Mostly not, see the reasons we discussed already. Most often that&#8217;s not needed. When it does make sense I use a </p>
<p>List persons = select(person, ageSelector);</p>
<p>I have the book for some years (thanks dostoyevsky ;-), it didn&#8217;t convince me back then. But because you re-recommend it to help my enlightenment, I&#8217;ll take another look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Iry</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52360</link>
		<dc:creator>James Iry</dc:creator>
		<pubDate>Fri, 01 Feb 2008 01:59:35 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52360</guid>
		<description>Doug was making a joke based on the "purely functional" meaning of functional programming - i.e. programming without side effects.  If you strip out all but the R(read) in CRUD (create read update delete) then purely functional is pretty easy, but the application might suffer.  Of course, he knows that's a joke, there's no conceptual reason it couldn't be done in Haskell (see http://www.haskell.org/haskellDB/ for a proof of concept, though definitely not ready for prime time, example).

Anyway, it's irrelevant since you asked about Lisp, by which people usually mean Common Lisp, which is an impure language (it allows arbitrary side effects).  Importantly it has both OO and functional features.  Let me turn this around, how would YOU write an enterprise app in language with both OO and functional features?  What if you had the ability to extend the language's syntax with your own syntax?  What if there was an implementation (ABCL) on the JVM so you could even use all your favorite libraries?  I know you're going to object that it's no longer FP at that point - but there's no reason you can't throw as much FP into the mix as you want, by whatever your definition.

How would it be done in Arc?  Who knows, it just got released today.  Nobody knows anything about it except PG and a few hard core fans.

Also, I want to re-recommend Practical Common Lisp.  Yeah he doesn't explain exactly your domain, but the general idea of using syntactic abstraction (macros) to create your own DSL (domain specific language) applies across all domains.</description>
		<content:encoded><![CDATA[<p>Doug was making a joke based on the &#8220;purely functional&#8221; meaning of functional programming - i.e. programming without side effects.  If you strip out all but the R(read) in CRUD (create read update delete) then purely functional is pretty easy, but the application might suffer.  Of course, he knows that&#8217;s a joke, there&#8217;s no conceptual reason it couldn&#8217;t be done in Haskell (see <a href="http://www.haskell.org/haskellDB/" rel="nofollow">http://www.haskell.org/haskellDB/</a> for a proof of concept, though definitely not ready for prime time, example).</p>
<p>Anyway, it&#8217;s irrelevant since you asked about Lisp, by which people usually mean Common Lisp, which is an impure language (it allows arbitrary side effects).  Importantly it has both OO and functional features.  Let me turn this around, how would YOU write an enterprise app in language with both OO and functional features?  What if you had the ability to extend the language&#8217;s syntax with your own syntax?  What if there was an implementation (ABCL) on the JVM so you could even use all your favorite libraries?  I know you&#8217;re going to object that it&#8217;s no longer FP at that point - but there&#8217;s no reason you can&#8217;t throw as much FP into the mix as you want, by whatever your definition.</p>
<p>How would it be done in Arc?  Who knows, it just got released today.  Nobody knows anything about it except PG and a few hard core fans.</p>
<p>Also, I want to re-recommend Practical Common Lisp.  Yeah he doesn&#8217;t explain exactly your domain, but the general idea of using syntactic abstraction (macros) to create your own DSL (domain specific language) applies across all domains.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52273</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Thu, 31 Jan 2008 17:51:23 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52273</guid>
		<description>@Doug: As always imagine I have no clue what you are talking about. From my experience it's always best if people assume no clues on my side.

But I do like &lt;a href="http://cran.r-project.org/doc/manuals/R-intro.html" rel="nofollow"&gt;R&lt;/&gt; and &lt;a href="http://www.kuro5hin.org/story/2002/11/14/22741/791" rel="nofollow"&gt;K&lt;/a&gt; as programming languages. &lt;a href="http://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131101633" rel="nofollow"&gt;C&lt;/a&gt; and &lt;a href="http://www.aplusdev.org/" rel="nofollow"&gt;A&lt;/a&gt; not so much. &lt;a href="http://wouter.fov120.com/proglang/" rel="nofollow"&gt;E&lt;/a&gt; was funny but didn't make it. And &lt;a href="http://www.digitalmars.com/d/" rel="nofollow"&gt;D&lt;/A&gt;?

Lately I asked a candidate about ACID in an interview. It's funny when people want to use transaction for a R-only application. CRUD seams a non-issue nowadays.</description>
		<content:encoded><![CDATA[<p>@Doug: As always imagine I have no clue what you are talking about. From my experience it&#8217;s always best if people assume no clues on my side.</p>
<p>But I do like <a href="http://cran.r-project.org/doc/manuals/R-intro.html" rel="nofollow">R and </a><a href="http://www.kuro5hin.org/story/2002/11/14/22741/791" rel="nofollow">K</a> as programming languages. <a href="http://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131101633" rel="nofollow">C</a> and <a href="http://www.aplusdev.org/" rel="nofollow">A</a> not so much. <a href="http://wouter.fov120.com/proglang/" rel="nofollow">E</a> was funny but didn&#8217;t make it. And <a href="http://www.digitalmars.com/d/" rel="nofollow">D</a>?</p>
<p>Lately I asked a candidate about ACID in an interview. It&#8217;s funny when people want to use transaction for a R-only application. CRUD seams a non-issue nowadays.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Pardee</title>
		<link>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52269</link>
		<dc:creator>Doug Pardee</dc:creator>
		<pubDate>Thu, 31 Jan 2008 17:44:48 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/01/31/show-me-functional-programming-i-have-no-clue-obviously/#comment-52269</guid>
		<description>ACID becomes basic when CRUD is reduced to just R.

Application functionality tends to suffer a mite, though.</description>
		<content:encoded><![CDATA[<p>ACID becomes basic when CRUD is reduced to just R.</p>
<p>Application functionality tends to suffer a mite, though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
