<?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>Comments on: Imperative programming is a special type of functional programming</title>
	<atom:link href="http://blog.tmorris.net/imperative-programming-is-a-special-type-of-functional-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tmorris.net/imperative-programming-is-a-special-type-of-functional-programming/</link>
	<description>The weblog of Tony Morris</description>
	<pubDate>Tue, 06 Jan 2009 06:21:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: John "Z-Bo" Zabroski</title>
		<link>http://blog.tmorris.net/imperative-programming-is-a-special-type-of-functional-programming/#comment-1642</link>
		<dc:creator>John "Z-Bo" Zabroski</dc:creator>
		<pubDate>Sun, 12 Aug 2007 06:54:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/imperative-programming-is-a-special-type-of-functional-programming/#comment-1642</guid>
		<description>In conclusion, the split between functional programming and imperative programming is a false dichotomy and a frantic ontology.  The current ontology is just as frantic: There is a large amount of variability in what can be considered an imperative language and what constitutes a strong hint on &lt;i&gt;how&lt;/i&gt; to do something.  For some reason, most people understand intuitively what these strong hints are although there is no precise way to define them.  We could argue that allowing manipulation of memory addresses as in C is a strong hint, but how do we explain control constructs like the for statement in C as being imperative in comparison to more explicit control structures in Haskell?  If there is a good explanation for this, it is beyond my reach.</description>
		<content:encoded><![CDATA[<p>In conclusion, the split between functional programming and imperative programming is a false dichotomy and a frantic ontology.  The current ontology is just as frantic: There is a large amount of variability in what can be considered an imperative language and what constitutes a strong hint on <i>how</i> to do something.  For some reason, most people understand intuitively what these strong hints are although there is no precise way to define them.  We could argue that allowing manipulation of memory addresses as in C is a strong hint, but how do we explain control constructs like the for statement in C as being imperative in comparison to more explicit control structures in Haskell?  If there is a good explanation for this, it is beyond my reach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John "Z-Bo" Zabroski</title>
		<link>http://blog.tmorris.net/imperative-programming-is-a-special-type-of-functional-programming/#comment-1641</link>
		<dc:creator>John "Z-Bo" Zabroski</dc:creator>
		<pubDate>Sun, 12 Aug 2007 06:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/imperative-programming-is-a-special-type-of-functional-programming/#comment-1641</guid>
		<description>How deep is your analysis, really?  All you have done is traded one poor ontology for another poor ontology.  Dijkstra warned us about this: Trading one conceptual breakdown for another means nothing unless it allows us to &lt;i&gt;separate concerns&lt;/i&gt;.

First, you did not identify the original dichotomy between functional programming and imperative programming, and did not relate why the dichotomy came about.  I think you don't understand why, and assert that understanding why is critical to understanding how the terms are commonly defined.

On this matter, I'll quote perhaps the most widely respected book on programming aesthetics, Michael Scott's Programming Language Pragmatics: "The many existing languages can be classified into families based on their model of computation. [...] The top-level division distinguishes between the &lt;i&gt;declarative&lt;/i&gt; languages, in which focus is on &lt;i&gt;what&lt;/i&gt; to do, and the &lt;i&gt;imperative&lt;/i&gt; languages, in which focus is on &lt;i&gt;how&lt;/i&gt; the computer should do it.  Declarative languages are in some sense 'higher level'; they are more in tune with the programmer's point of view, and less in tune with the implementor's point of view" (Page 5).  In a so-called high-level language, the programmer's view-point and the implementor's view-point will never be exactly the same.  However, imperative languages provide strong hints about &lt;i&gt;how&lt;/i&gt; to do something.

In truth, it is a mistake to call languages with an object-oriented model &lt;i&gt;imperative&lt;/i&gt; and it is a mistake to believe Wikipedia when it says &lt;i&gt;functional programming is in contrast to imperative programming&lt;/i&gt;.  To illustrate my point with a trivial example, the object-oriented model generally supports reflection, which is neither declarative or imperative but instead &lt;i&gt;interrogative&lt;/i&gt;.

However, it is also incorrect to say that imperative programming is a division of functional programming.  Why would you want to compartmentalize functional programming in this way?  What value does it bring other than familiarity which is always subject to opinion?  Changing ontologies here does not seem beneficial to the programmer or implementor.  In fact, it is just as frantic a categorization as the original ontology.  I would rather model my problems at a higher level of abstraction.  As Christopher Strachey once said: &lt;i&gt;figure out what you want to say before you figure out how to say it&lt;/i&gt;.  What you want to say will generally need to include some mix of knowledge to form a cohesive picture of the problem application domain.  If you are building a tool that sits atop a language or some API for that language, then interrogation is quite useful.

Come to that, I have something to say about this quote: "In the relatively rare (though inevitable) case of performing I/O, only then will I resort to the imperative programming technique within pure functional programming."  My intuition says that you should resort to describing the part of your problem that requires imperative knowledge with imperative programming.  I/O happens to fit this case well, and it is also an area of programming that succeeds well with programming-by-contract when it comes to writing portable code.</description>
		<content:encoded><![CDATA[<p>How deep is your analysis, really?  All you have done is traded one poor ontology for another poor ontology.  Dijkstra warned us about this: Trading one conceptual breakdown for another means nothing unless it allows us to <i>separate concerns</i>.</p>
<p>First, you did not identify the original dichotomy between functional programming and imperative programming, and did not relate why the dichotomy came about.  I think you don&#8217;t understand why, and assert that understanding why is critical to understanding how the terms are commonly defined.</p>
<p>On this matter, I&#8217;ll quote perhaps the most widely respected book on programming aesthetics, Michael Scott&#8217;s Programming Language Pragmatics: &#8220;The many existing languages can be classified into families based on their model of computation. [...] The top-level division distinguishes between the <i>declarative</i> languages, in which focus is on <i>what</i> to do, and the <i>imperative</i> languages, in which focus is on <i>how</i> the computer should do it.  Declarative languages are in some sense &#8216;higher level&#8217;; they are more in tune with the programmer&#8217;s point of view, and less in tune with the implementor&#8217;s point of view&#8221; (Page 5).  In a so-called high-level language, the programmer&#8217;s view-point and the implementor&#8217;s view-point will never be exactly the same.  However, imperative languages provide strong hints about <i>how</i> to do something.</p>
<p>In truth, it is a mistake to call languages with an object-oriented model <i>imperative</i> and it is a mistake to believe Wikipedia when it says <i>functional programming is in contrast to imperative programming</i>.  To illustrate my point with a trivial example, the object-oriented model generally supports reflection, which is neither declarative or imperative but instead <i>interrogative</i>.</p>
<p>However, it is also incorrect to say that imperative programming is a division of functional programming.  Why would you want to compartmentalize functional programming in this way?  What value does it bring other than familiarity which is always subject to opinion?  Changing ontologies here does not seem beneficial to the programmer or implementor.  In fact, it is just as frantic a categorization as the original ontology.  I would rather model my problems at a higher level of abstraction.  As Christopher Strachey once said: <i>figure out what you want to say before you figure out how to say it</i>.  What you want to say will generally need to include some mix of knowledge to form a cohesive picture of the problem application domain.  If you are building a tool that sits atop a language or some API for that language, then interrogation is quite useful.</p>
<p>Come to that, I have something to say about this quote: &#8220;In the relatively rare (though inevitable) case of performing I/O, only then will I resort to the imperative programming technique within pure functional programming.&#8221;  My intuition says that you should resort to describing the part of your problem that requires imperative knowledge with imperative programming.  I/O happens to fit this case well, and it is also an area of programming that succeeds well with programming-by-contract when it comes to writing portable code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
