<?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"
	>
<channel>
	<title>Kommentare zu: From Functional to Object-Oriented Programming</title>
	<atom:link href="http://www.wuenschenswert.net/wunschdenken/archives/117/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wuenschenswert.net/wunschdenken/archives/117</link>
	<description></description>
	<pubDate>Tue, 07 Feb 2012 16:26:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>Von: Alf</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-95</link>
		<dc:creator>Alf</dc:creator>
		<pubDate>Sun, 04 Feb 2007 17:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-95</guid>
		<description>"If somebody does not know the idiom and takes you literally, it’s comedy time."

I'm not so worried about the one who hasn't seen the idiom before.

I'm more worried about the person who has seen the idiom many times before, and has learned to "read" it as a unit.

Example: Did anyone actually notice the bug in the inlined code I used in my example? I wanted to prove a point: Inlining of control flow constructs out of fear that abstraction would make the code abstruse and unreadable is not only morally wrong; it can actually cause its own class of bugs.


(let me apologize for the dishonest phrasing of my first comment -- I wanted to show how easy it is to misread inlined code, and I couldn't figure out a way to be frank about it without ruining the "example")</description>
		<content:encoded><![CDATA[<p>&#8220;If somebody does not know the idiom and takes you literally, it’s comedy time.&#8221;</p>
<p>I&#8217;m not so worried about the one who hasn&#8217;t seen the idiom before.</p>
<p>I&#8217;m more worried about the person who has seen the idiom many times before, and has learned to &#8220;read&#8221; it as a unit.</p>
<p>Example: Did anyone actually notice the bug in the inlined code I used in my example? I wanted to prove a point: Inlining of control flow constructs out of fear that abstraction would make the code abstruse and unreadable is not only morally wrong; it can actually cause its own class of bugs.</p>
<p>(let me apologize for the dishonest phrasing of my first comment &#8212; I wanted to show how easy it is to misread inlined code, and I couldn&#8217;t figure out a way to be frank about it without ruining the &#8220;example&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: axel</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-93</link>
		<dc:creator>axel</dc:creator>
		<pubDate>Sat, 03 Feb 2007 22:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-93</guid>
		<description>@Alf: Upon re-reading your comment, I realize you argued for the expanded idiom, instead of a closure abstraction.

You ask "does the difference in code size really make it worth the complexity of not being able to see inline what the mappedWith() function does?"

The problem with idioms is that apart from the metaphorical meaning (the reason why you chose to use the idiom) they also have a concrete meaning, which is often much more concrete than, or completely different from, the situation in which you use the idiom.  If somebody does not know the idiom and takes you literally, it's comedy time.

Translating this to code, the problem is that the expanded form - the idiom - prescribes more than it should. Is it really necessary that a variable "iter" is introduced (and can be inspected in a debugger) that is bound to an object with a unique identity? And that the results of the iterator are delivered one after the other?

I would say - no, code size alone is not it. The real difference is between

ListUtil.map(l,fun(String s){ s.toUpperCase() })

and

l.map(fun(String s){ s.toUpperCase() })

the latter being object-oriented, with an implementation that depends on the concrete type of collection, and the former being just an abbreviation (where the implementation might be exchanged in theory, but not in practice, for backwards compatibility reasons). 

There's more to say about this - probably enough for another post!</description>
		<content:encoded><![CDATA[<p>@Alf: Upon re-reading your comment, I realize you argued for the expanded idiom, instead of a closure abstraction.</p>
<p>You ask &#8220;does the difference in code size really make it worth the complexity of not being able to see inline what the mappedWith() function does?&#8221;</p>
<p>The problem with idioms is that apart from the metaphorical meaning (the reason why you chose to use the idiom) they also have a concrete meaning, which is often much more concrete than, or completely different from, the situation in which you use the idiom.  If somebody does not know the idiom and takes you literally, it&#8217;s comedy time.</p>
<p>Translating this to code, the problem is that the expanded form - the idiom - prescribes more than it should. Is it really necessary that a variable &#8220;iter&#8221; is introduced (and can be inspected in a debugger) that is bound to an object with a unique identity? And that the results of the iterator are delivered one after the other?</p>
<p>I would say - no, code size alone is not it. The real difference is between</p>
<p>ListUtil.map(l,fun(String s){ s.toUpperCase() })</p>
<p>and</p>
<p>l.map(fun(String s){ s.toUpperCase() })</p>
<p>the latter being object-oriented, with an implementation that depends on the concrete type of collection, and the former being just an abbreviation (where the implementation might be exchanged in theory, but not in practice, for backwards compatibility reasons). </p>
<p>There&#8217;s more to say about this - probably enough for another post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Wunschdenken &#187; Blog Archiv &#187; Higher-Order Functions and the Object-Oriented Paradigm</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-90</link>
		<dc:creator>Wunschdenken &#187; Blog Archiv &#187; Higher-Order Functions and the Object-Oriented Paradigm</dc:creator>
		<pubDate>Sat, 03 Feb 2007 17:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-90</guid>
		<description>[...] Wunschdenken       &#171; From Functional to Object-Oriented Programming [...]</description>
		<content:encoded><![CDATA[<p>[...] Wunschdenken       &laquo; From Functional to Object-Oriented Programming [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Reg Braithwaite</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-89</link>
		<dc:creator>Reg Braithwaite</dc:creator>
		<pubDate>Sat, 03 Feb 2007 17:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-89</guid>
		<description>"What about HOOOP?"

I can't think of a post yet, maybe you'll think of one. But the title jumps out and begs for someone, anyone to write an essay:

"HOOOP Dreams"

http://www.imdb.com/title/tt0110057/</description>
		<content:encoded><![CDATA[<p>&#8220;What about HOOOP?&#8221;</p>
<p>I can&#8217;t think of a post yet, maybe you&#8217;ll think of one. But the title jumps out and begs for someone, anyone to write an essay:</p>
<p>&#8220;HOOOP Dreams&#8221;</p>
<p><a href="http://www.imdb.com/title/tt0110057/" rel="nofollow">http://www.imdb.com/title/tt0110057/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: axel</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-88</link>
		<dc:creator>axel</dc:creator>
		<pubDate>Sat, 03 Feb 2007 01:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-88</guid>
		<description>@Alf: The example you cite - closures for iteration abstraction - is the other example where closures excel. The first example being the currying operations Reg cited in his post. Resource allocation/deallocation might be another good example.

All of these are mechanisms for avoiding to name things that do not need names. My line still is: OOP is an advance over functional programming. Because functional programming tempts you to name too few things, and makes you create abstractions in a way that is hard to communicate to anyone unfamiliar with your code.

The challenge in my view is in adding functional features to an OO language without falling into the nameless abstraction trap.

To Warren: I am not talking about the complexity of the language, but about the complexity of a typical program written in that language. Schemers have a tendency to outsmart themselves (at least I did when I was hacking Scheme).  About math being the perfect world description, I doubt it - math is not very good at anchoring your model in a conceptual context, math's power kicks in as soon as you leave the reallity plane and start working purely at the level of abstraction. Lots of software today is not system software, so we need to relate to "real" requirements. And does OOP make software easy? Well, a systematic approach always means not doing everything you could, so that the things you do have some guaranteed properties. Which implies restricting yourself to the things you can now do with sensible effort. And about design patterns: Have you seen the "OO" design pattern in Scheme? Ugly as hell. Scala: always wanted to take a look at that, and I definitely will, if I just wasn't in an office full of screaming morons most of my time ;-)

Sorry, it's late, I'll come back to the points I missed!

What about HOOOP? (Higher-Order Object-Oriented Programming)</description>
		<content:encoded><![CDATA[<p>@Alf: The example you cite - closures for iteration abstraction - is the other example where closures excel. The first example being the currying operations Reg cited in his post. Resource allocation/deallocation might be another good example.</p>
<p>All of these are mechanisms for avoiding to name things that do not need names. My line still is: OOP is an advance over functional programming. Because functional programming tempts you to name too few things, and makes you create abstractions in a way that is hard to communicate to anyone unfamiliar with your code.</p>
<p>The challenge in my view is in adding functional features to an OO language without falling into the nameless abstraction trap.</p>
<p>To Warren: I am not talking about the complexity of the language, but about the complexity of a typical program written in that language. Schemers have a tendency to outsmart themselves (at least I did when I was hacking Scheme).  About math being the perfect world description, I doubt it - math is not very good at anchoring your model in a conceptual context, math&#8217;s power kicks in as soon as you leave the reallity plane and start working purely at the level of abstraction. Lots of software today is not system software, so we need to relate to &#8220;real&#8221; requirements. And does OOP make software easy? Well, a systematic approach always means not doing everything you could, so that the things you do have some guaranteed properties. Which implies restricting yourself to the things you can now do with sensible effort. And about design patterns: Have you seen the &#8220;OO&#8221; design pattern in Scheme? Ugly as hell. Scala: always wanted to take a look at that, and I definitely will, if I just wasn&#8217;t in an office full of screaming morons most of my time <img src='http://www.wuenschenswert.net/wunschdenken/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Sorry, it&#8217;s late, I&#8217;ll come back to the points I missed!</p>
<p>What about HOOOP? (Higher-Order Object-Oriented Programming)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Warren Henning</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-87</link>
		<dc:creator>Warren Henning</dc:creator>
		<pubDate>Fri, 02 Feb 2007 18:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-87</guid>
		<description>I don't think Java or C++ are less complex/challenging than Scheme. To the contrary.

"Language is not understood best when you have removed as much as possible. Would you rather read a novel, or an algebra textbook?"

Actually, the notation and other measures taken to ensure brevity in math arose by no accident. They are essential. Math must consider difficult abstract concepts and the only way to effectively communicate that is to do it in a special way. Math is understood far, far better when you have symbols instead of words. The brevity there makes things that would otherwise be impossible to explain possible. This is the math that makes it possible to build suspension bridges and all the other things in our daily lives we take for granted.

"Conciseness comes at a price: The more compressed your code, the harder it is to understand what the consequence of some change would be."

What?

"I strongly associate higher-order functional programming with long stretches of uninterrupted concentrated programming work, and single-person projects."

Object-oriented programming is therefore for when you are in an office full of screaming morons and no one gets any work done? Does OOP magically make software easy? I doubt it.

"Object-oriented programming was introduced to fill a need not satisfied by functional and imperative languages. Remember: Going from functional to OO is an advance."

Thinking you don't need to take functions seriously is ridiculous and is why you have entire "design patterns" that are invisible in functional languages.

Have you heard about the Scala programming language? You've been claiming throughout this article that functional programming and OOP are somehow incompatible and it's undesirable to have both; I think that's an unreasonable bifurcation. think both are useful in different situations. Scala unifies functional programming and object-oriented programming nicely. It runs on the JVM. You should have a look. http://scala-lang.org .</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think Java or C++ are less complex/challenging than Scheme. To the contrary.</p>
<p>&#8220;Language is not understood best when you have removed as much as possible. Would you rather read a novel, or an algebra textbook?&#8221;</p>
<p>Actually, the notation and other measures taken to ensure brevity in math arose by no accident. They are essential. Math must consider difficult abstract concepts and the only way to effectively communicate that is to do it in a special way. Math is understood far, far better when you have symbols instead of words. The brevity there makes things that would otherwise be impossible to explain possible. This is the math that makes it possible to build suspension bridges and all the other things in our daily lives we take for granted.</p>
<p>&#8220;Conciseness comes at a price: The more compressed your code, the harder it is to understand what the consequence of some change would be.&#8221;</p>
<p>What?</p>
<p>&#8220;I strongly associate higher-order functional programming with long stretches of uninterrupted concentrated programming work, and single-person projects.&#8221;</p>
<p>Object-oriented programming is therefore for when you are in an office full of screaming morons and no one gets any work done? Does OOP magically make software easy? I doubt it.</p>
<p>&#8220;Object-oriented programming was introduced to fill a need not satisfied by functional and imperative languages. Remember: Going from functional to OO is an advance.&#8221;</p>
<p>Thinking you don&#8217;t need to take functions seriously is ridiculous and is why you have entire &#8220;design patterns&#8221; that are invisible in functional languages.</p>
<p>Have you heard about the Scala programming language? You&#8217;ve been claiming throughout this article that functional programming and OOP are somehow incompatible and it&#8217;s undesirable to have both; I think that&#8217;s an unreasonable bifurcation. think both are useful in different situations. Scala unifies functional programming and object-oriented programming nicely. It runs on the JVM. You should have a look. <a href="http://scala-lang.org" rel="nofollow">http://scala-lang.org</a> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Reg Braithwaite</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-86</link>
		<dc:creator>Reg Braithwaite</dc:creator>
		<pubDate>Fri, 02 Feb 2007 15:40:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-86</guid>
		<description>HOF or OOP? Yes!

http://weblog.raganwald.com/2007/02/hof-or-oop-yes.html</description>
		<content:encoded><![CDATA[<p>HOF or OOP? Yes!</p>
<p><a href="http://weblog.raganwald.com/2007/02/hof-or-oop-yes.html" rel="nofollow">http://weblog.raganwald.com/2007/02/hof-or-oop-yes.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Alf</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-85</link>
		<dc:creator>Alf</dc:creator>
		<pubDate>Fri, 02 Feb 2007 15:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-85</guid>
		<description>People often argue that using closures for a function such as 'map' is
so much more readable than just allocating a list and using a for
loop.

The thing is, after you have read the for loop version many times, it
becomes just as easy to read. You see it, you *know* what it is doing,
and you sort of tune out the boilerplate, and just see the code that
is actually doing the work.

Once that has happened, does the difference in code size between

return list.mappedWith({ 
  String s =&#62; s.toUpperCase() 
});

and

List newList = new ArrayList();
for(Iterator iter = newList.iterator(); iter.hasNext(); iter.next()) {
  String element = (String) iter.next();
  newList.add(element.toUpperCase());
}
return newList();

really make it worth the complexity of not being able to see inline
what the mappedWith() function does?</description>
		<content:encoded><![CDATA[<p>People often argue that using closures for a function such as &#8216;map&#8217; is<br />
so much more readable than just allocating a list and using a for<br />
loop.</p>
<p>The thing is, after you have read the for loop version many times, it<br />
becomes just as easy to read. You see it, you *know* what it is doing,<br />
and you sort of tune out the boilerplate, and just see the code that<br />
is actually doing the work.</p>
<p>Once that has happened, does the difference in code size between</p>
<p>return list.mappedWith({<br />
  String s =&gt; s.toUpperCase()<br />
});</p>
<p>and</p>
<p>List newList = new ArrayList();<br />
for(Iterator iter = newList.iterator(); iter.hasNext(); iter.next()) {<br />
  String element = (String) iter.next();<br />
  newList.add(element.toUpperCase());<br />
}<br />
return newList();</p>
<p>really make it worth the complexity of not being able to see inline<br />
what the mappedWith() function does?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Just grin and bear it&#8230; - Where are we going again?</title>
		<link>http://www.wuenschenswert.net/wunschdenken/archives/117#comment-84</link>
		<dc:creator>Just grin and bear it&#8230; - Where are we going again?</dc:creator>
		<pubDate>Fri, 02 Feb 2007 11:44:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.wuenschenswert.net/wunschdenken/archives/117#comment-84</guid>
		<description>[...] some historic perspective courtesy of Axel. [...]</description>
		<content:encoded><![CDATA[<p>[...] some historic perspective courtesy of Axel. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

