<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Artful Code &#187; oop</title>
	<atom:link href="http://www.artfulcode.net/tags/oop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artfulcode.net</link>
	<description>Resources and tips for dynamic, interactive languages.</description>
	<lastBuildDate>Fri, 09 Sep 2011 02:15:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>What is FOOP?</title>
		<link>http://www.artfulcode.net/articles/what-is-foop/</link>
		<comments>http://www.artfulcode.net/articles/what-is-foop/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 21:18:52 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[foop]]></category>
		<category><![CDATA[newlisp]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/what-is-foop/</guid>
		<description><![CDATA[FOOP is the concept of functional object oriented programming in newLISP. It originated in a thread on the newLISP forum and was officially added to the interpreter for newLISP 9.3. To be fair, the FOOP operator, :, does not provide any truly new functionality to newLISP. However, it does make prototyping much more concise and [...]]]></description>
			<content:encoded><![CDATA[<p>FOOP is the concept of <em>functional object oriented programming</em> in newLISP.  It originated in a thread on the newLISP forum and was officially added to the interpreter for newLISP 9.3.<span id="more-36"></span></p>
<p>To be fair, the FOOP operator, <code>:</code>, does not provide any truly new functionality to newLISP.  However, it does make prototyping much more concise and expressive.</p>
<h4>The basics</h4>
<p>Prototyping is accomplished using a source <code>context</code> (a lexical closure) and the <code>new</code> keyword.  Using the commonly contrived example of the Rectangle object:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>context 'Rectangle<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'x <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'y <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>area<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>* x y<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>context MAIN<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>new Rectangle 'my-rectangle<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'my-rectangle<span style="color: #66cc66;">:</span><span style="color: #555;">x</span> <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'my-rectangle<span style="color: #66cc66;">:</span><span style="color: #555;">y</span> <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>FOOP uses the convention of <code>(object member member ...)</code> for storing object instances.  Instance data, apart from the members, is encapsulated within the context, so all of the methods may access contextually set variables.  Although not built into the interpreter, the functional convention,</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>Class<span style="color: #66cc66;">:</span><span style="color: #555;">Class</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cons</span> <span style="color: #66cc66;">&#40;</span>context<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>args<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>&#8230;is typically used to create new contexts for FOOP.  Using <code>Class</code>, the above example would be written as:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>new Class 'Rectangle<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'my-rectangle <span style="color: #66cc66;">&#40;</span>Rectangle <span style="color: #cc66cc;">10</span> <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Methods are attached via the normal syntax for declaring foreign context functions, but with the assumption of the argument being the <code>(object member member ...)</code> convention and implicit indexing:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>Rectangle<span style="color: #66cc66;">:</span><span style="color: #555;">area</span> self<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>* <span style="color: #66cc66;">&#40;</span>self <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>self <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>All of the normal operations that apply to contexts remain applicable for contexts created in this fashion.  One interesting element of FOOP is that the methods and namespace are separate from the object&#8217;s properties.  Therefore, an arbitrary list of values can be consed by a cloned context to create a new instance.</p>
<p>Constructors are easily overridden using <a href="http://www.newlisp.org/downloads/newlisp_manual.html#default_function">default functors</a>.  In fact, <code>Class:Class</code> merely automates the creation of a default functor for a new context.</p>
<p>So, if we wanted a Rectangle with default x and y values:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>Rectangle<span style="color: #66cc66;">:</span><span style="color: #555;">Rectangle</span> <span style="color: #66cc66;">&#40;</span>x <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>y <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">list</span> <span style="color: #66cc66;">&#40;</span>context<span style="color: #66cc66;">&#41;</span> x y<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<h4>Solving problems with FOOP</h4>
<p>Although FOOP would not be considered a <em>true</em> object oriented system by <a href="http://paulgraham.com/reesoo.html">purists</a> (who would call it prototyping), it is an excellent substitute for a true type system.  For example, here is a simple interface for probing and validating command-line arguments:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">;; In case Class is not yet defined, attempt to define</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">catch</span>
  <span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>Class<span style="color: #66cc66;">:</span><span style="color: #555;">Class</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cons</span> <span style="color: #66cc66;">&#40;</span>context<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>args<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;; Declare our classes</span>
<span style="color: #66cc66;">&#40;</span>new Class 'Option<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>new Class 'Switch<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; Option's identifying token</span>
<span style="color: #66cc66;">&#40;</span>new Class 'Required<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; Defines option as required</span>
<span style="color: #66cc66;">&#40;</span>new Class 'Predicate<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; Lambda to validate and option's value</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;; Define a method to find this option in (main-args)</span>
<span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>Option<span style="color: #66cc66;">:</span><span style="color: #b1b100;">get</span> self <span style="color: #66cc66;">,</span> loc val<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'switch <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">last</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">assoc</span> <span style="color: #66cc66;">&#40;</span>self Switch<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'loc <span style="color: #66cc66;">&#40;</span>find switch <span style="color: #66cc66;">&#40;</span>main-args<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cond</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> <span style="color: #66cc66;">&#40;</span>starts-with switch <span style="color: #ff0000;">&quot;--&quot;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">catch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">nth</span> <span style="color: #66cc66;">&#40;</span>+ <span style="color: #cc66cc;">1</span> loc<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>main-args<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> 'val<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
        val<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>starts-with switch <span style="color: #ff0000;">&quot;--&quot;</span><span style="color: #66cc66;">&#41;</span> true<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>starts-with switch <span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #66cc66;">&#41;</span> true<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>true <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;; Define a predicate to validate the value of our option.</span>
<span style="color: #808080; font-style: italic;">;; In case the option does not come with a value, we skip the predicate</span>
<span style="color: #808080; font-style: italic;">;; part and validate solely based on the value of Required.</span>
<span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>Option<span style="color: #66cc66;">:</span><span style="color: #555;">valid</span>? self <span style="color: #66cc66;">,</span> val req pred req? pred?<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'val <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #b1b100;">get</span> self<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'req? <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">assoc</span> <span style="color: #66cc66;">&#40;</span>self Required<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'pred? <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">assoc</span> <span style="color: #66cc66;">&#40;</span>self Predicate<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'req <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> req? <span style="color: #66cc66;">&#40;</span>true? val<span style="color: #66cc66;">&#41;</span> true<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'pred <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> pred? <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">last</span> pred?<span style="color: #66cc66;">&#41;</span> val<span style="color: #66cc66;">&#41;</span> true<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> req pred<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>The Option class is made up of several other classes, Switch, Required, and Predicate.  Switch is the token to identify the option in the command-line arguments.  Switches that begin with &#8212; can take an optional value, such as <code>--url http://www.artfulcode.net</code>.  Required is another empty class that only needs to be a boolean value.  Predicate optionally stores a lambda that will be used to validate the value found in <code>(main-args)</code>.</p>
<p>Here is a sample of how we might use <code>Option</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'url <span style="color: #66cc66;">&#40;</span>Option
    <span style="color: #66cc66;">&#40;</span>Switch <span style="color: #ff0000;">&quot;--url&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>Required true<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>Predicate
        <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span>val<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>true? <span style="color: #66cc66;">&#40;</span>regex <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">^</span>http<span style="color: #66cc66;">:</span>//<span style="color: #66cc66;">.</span>*?$<span style="color: #66cc66;">&#125;</span> val <span style="color: #cc66cc;">17</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>For a single on/off switch, we can do:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'some-option <span style="color: #66cc66;">&#40;</span>Option
    <span style="color: #66cc66;">&#40;</span>Switch <span style="color: #ff0000;">&quot;-s&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>Required <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>To get the values and validate them:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">artful<span style="color: #66cc66;">:</span>~ newlisp test<span style="color: #66cc66;">.</span>lsp --url http<span style="color: #66cc66;">:</span>//www<span style="color: #66cc66;">.</span>artfulcode<span style="color: #66cc66;">.</span>net -s
&nbsp;
<span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">:</span><span style="color: #b1b100;">get</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&gt; &quot;http://www.artfulcode.net&quot;</span>
<span style="color: #66cc66;">&#40;</span>some-option<span style="color: #66cc66;">:</span><span style="color: #b1b100;">get</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&amp;gt; true</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">:</span><span style="color: #555;">valid</span>?<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&gt; true</span>
<span style="color: #66cc66;">&#40;</span>some-option<span style="color: #66cc66;">:</span><span style="color: #555;">valid</span>?<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&gt; true</span></pre></div></div>

<p>And for non-validating values:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">artful<span style="color: #66cc66;">:</span>~ newlisp test<span style="color: #66cc66;">.</span>lsp --url <span style="color: #ff0000;">&quot;Hello world&quot;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">:</span><span style="color: #b1b100;">get</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&gt; &quot;Hello world&quot;</span>
<span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">:</span><span style="color: #555;">valid</span>?<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&gt; nil</span></pre></div></div>

<p>newLISP 9.3&#8242;s new association list processing functions make accessing member cells a snap &#8211; <code>(assoc (object key))</code>.  Obviously, this is more expressive and concise than a lot of recursive parsing of <code>(main-args)</code>.  The trade-off is the same as with any use of OOP: contexts are more expensive than list processing, especially when creating many small context instances.</p>
<p>This is obviously a contrived example and could be solved more efficiently quite easily, but it does a good job of illustrating FOOP.</p>
<h4>What makes it functional?</h4>
<p>That&#8217;s tough to quantify.  However, if we want to shorten the class declarations in the code above to simplify our code, we could use use the higher order functions <a href="http://www.newlisp.org/downloads/newlisp_manual.html#map">map</a> and <a href="http://www.newlisp.org/downloads/newlisp_manual.html#curry">curry</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>map <span style="color: #66cc66;">&#40;</span>curry new Class<span style="color: #66cc66;">&#41;</span> '<span style="color: #66cc66;">&#40;</span>Option Switch Required Predicate<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Other examples might be to compose custom classes as needed using macros, updating a list of class instances using <code>map</code>, or currying class constructors to extend classes.</p>
<h4>What next?</h4>
<p>There are better and more extensive tutorials available in video form courtesy of <a href="http://neglook.com/">Michael Michaels of neglOOk</a> available on the <a href="http://www.newlisp.org/index.cgi?Documentation">newLisp website</a>.</p>
<p><a href="/wp-content/uploads/2008/12/argslsp.gz">download</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F&amp;title=What+is+FOOP%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F&amp;title=What+is+FOOP%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=What+is+FOOP%3F&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F&amp;title=What+is+FOOP%3F" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F&amp;title=What+is+FOOP%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F&amp;title=What+is+FOOP%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+What+is+FOOP%3F+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fwhat-is-foop%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/what-is-foop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java from a functional perspective</title>
		<link>http://www.artfulcode.net/articles/java-functional-perspective/</link>
		<comments>http://www.artfulcode.net/articles/java-functional-perspective/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 16:11:00 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/java-functional-perspective/</guid>
		<description><![CDATA[Not long ago a project required me to learn a little Java. As a long-time elitist functional programmer, I was not extremely excited. Due to the low quality of Java software I have used, I assumed, like many, that Java produced slow, bloated, and buggy software. Some languages just feel clunky. My previous experience with [...]]]></description>
			<content:encoded><![CDATA[<p>Not long ago a project required me to learn a little Java.  As a long-time elitist functional programmer, I was not extremely excited.  Due to the low quality of Java software I have used, I assumed, like many, that Java produced slow, bloated, and buggy software.  Some languages just feel clunky.<span id="more-45"></span></p>
<p>My previous experience with Java was as a less experienced programmer and I had some difficulty with the type system.  I learned on dynamically typed languages.  My first experience with static typing was in modern functional languages, where type was inferred automatically by the compiler.  Explicit type declarations felt archaic and overly wordy.</p>
<p>My experience this time around, however, was more positive.  This is primarily due to three factors.</p>
<h4>NetBeans</h4>
<p>NetBeans is Sun&#8217;s Java IDE.  Because it is mostly limited to Java, its syntax formating is excellent.  It takes a lot of code to abstract the ability of an IDE to format multiple languages (in particular, the ability to format both C-style languages and Lisp-style languages using the same application primitives presents difficulty).  NetBeans has the Apple advantage in this; one language to support means that it can have excellent support for that language.  Of course, this means that projects that use multiple languages are more difficult to develop using NetBeans, so perhaps this tradeoff is not worth it.</p>
<p>Java&#8217;s self-documentation is very nice, too.  NetBean&#8217;s code-hinting is superior to most, although it can get in the way.</p>
<p>The GUI builder is also extremely nice.  Swig and AWT can be a real trial in a language as wordy as Java (although I think Sun prefers us to call it &#8220;explicit.&#8221;)</p>
<h4>Classes</h4>
<p>I initially had some difficulty writing entire programs in objects.  Most languages I use that are object oriented are multi-paradigm.  Classes are available, but then utilized within functional or procedural code.  Because of this, I tend to regard classes as a sort of extra-powerful type struct, only to be used when a type becomes complex enough that the extra work of encapsulated it within a class becomes advantageous.</p>
<p>It&#8217;s (unfortunately) common to see new Lisp programmers try to simulate OO in Lisp using closures and hashes (especially if they&#8217;ve read a few Paul Graham essays).  I don&#8217;t particularly see that OO improves Lisp; closures and templates provide roughly the same functionality.  Exactly replicating closures in OOP or objects in functional programming would be moot.  They are different styles; Java-style programming is as uncomfortable in Lisp as Lisp-style programming is in Java.</p>
<p>While writing my initial applications, though, I realized something: classes are a formalized closure syntax.  They are a function that builds functions and closes over their variables.</p>
<p>This freed me to use a style of abstraction in Java that felt much more comfortable to me without the drawback of attempting to use the wrong paradigm for the language.  I could now program using classes and objects in a manner consistent with how I mentally model my applications.</p>
<p>Something I missed quite a bit was pattern matching.  It is very helpful to declare local variables based on the pattern of the argument(s) passed to a function, but that would not be useful in Java, since the primary type mechanism in Java is the class rather than the list.  Method overloading provides much of the same functionality, but idiomatic of Java.</p>
<h4>Write once, run everywhere</h4>
<p>Lisp pioneered the virtual machine.  Lisp is compiled into code that is run within the Lisp interpreter.  But Lisp is not commonly installed on computers, so distribution of Lisp software becomes a real challenge.  One of the advantages of having a huge amount of money behind a language is that Java is installed on virtually every computer a program may end up on.</p>
<p>It&#8217;s common in Lisp to have to code various parts of the program differently depending on the operating system and Lisp distribution.  For example, very few Lisps support multi-threading on OSX.  It makes it agonizing to write threaded software for a multi-platform application.</p>
<p>Java does not have this problem.  A feature is available on all platforms or none at all.  While this means that the language sometimes suffers from the lack of a particular feature, it also means that there is a guarantee against discovering too late that a feature used in the core of your program will not limit its utility on other operating systems.</p>
<h4>Conclusion</h4>
<p>Java is better than I had given it credit for.  With NetBeans taking care of checking your work for you, I am beginning to suspect that the many buggy Java programs are due to poor programming rather than a problem inherent in Java itself.</p>
<p>I still have some doubts as to how useful it would be for a very large project; my experience has been that object orientation and inheritance results in unnecessary complexity.</p>
<p>For small projects and GUI applications, though, Java seems to be a fair choice.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Java+from+a+functional+perspective&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Java+from+a+functional+perspective+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/java-functional-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding excess redundancy</title>
		<link>http://www.artfulcode.net/articles/avoiding-excess-redundancy/</link>
		<comments>http://www.artfulcode.net/articles/avoiding-excess-redundancy/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 13:11:00 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[newlisp]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/avoiding-excess-redundancy/</guid>
		<description><![CDATA[There is an interesting article at Irrational Exuberance about anti-objects and reflective design. The author states, &#8220;The first &#8211; and only &#8211; programming paradigm I was taught at college was OO.&#8221; Another recent blog post by a college CS tutor laments that object oriented design is the first (and often, the only) abstraction method taught [...]]]></description>
			<content:encoded><![CDATA[<p>There is an <a href="http://www.willarson.com/blog/?p=29">interesting article</a> at <a href="http://www.willarson.com/blog/">Irrational Exuberance</a> about anti-objects and reflective design.  The author states, &#8220;The first &#8211; and only &#8211; programming paradigm I was taught at college was OO.&#8221;  Another <a href="http://gildir.blogspot.com/2007/06/what-hell-is-class-and-why-do-we-use-it.html">recent blog post</a> by a college CS tutor laments that object oriented design is the first (and often, the only) abstraction method taught to students in computer science programs.<span id="more-57"></span></p>
<p>I tend to agree with this thinking.  OO is not the singular technique for code abstraction.  It is useful because it maps closely to how the brain conceptualizes entities.  Spot is a dog.  Spot barks.  Spot wags.  Spot contains a mutable state that describes him, and he responds to certain inputs.  Spot is an instance of canine, which in turn is an instance mammal, ad infinitum.</p>
<p>OO is a conceptually precise way to program, but it comes with a complexity and redundancy.  As my mantra states, expressiveness &gt; efficient &gt; elegant &gt; idiomatic.  Redundancy and complexity get in the way of expressiveness.</p>
<p>The article at Irrational Exuberance mentions <a href="http://en.wikipedia.org/wiki/Antiobjects">antiobjects</a> as a way of avoiding some of the overhead and complexity problems of OO without abandoning OO completely.  The context used is that of programming a MUD (with which I am just as guilty of wasting my teen years as the author).  The program defines Player and Item, with individual items subclassing Item.  A player can use an item.  The author shows how the methods for equipping an item can be stored in the player object or the item object, and that the latter (an example of using antiobjects) was more efficient.</p>
<p>In fact, the latter is more expressive as well.  It is not the person that determines how the item is used, but the item itself that describes its use (in the context of the game).  A player would not eat a sword.  This adds a logical constraint that does not mimic the real world &#8211; a player could eat a sword.  It&#8217;s got iron in it.  Very important for you, iron.  Practically a health food.</p>
<p>But in the context of the program, that would be ridiculous and would require a heck of a lot of extra coding work, adding an enormous amount of complexity to the program.  That&#8217;s a lot of work just to get a little extra iron in your diet.</p>
<p>One option the author did not explore at all is that OO might be overkill for the job.  In a MUD, players and items are not overly complex concepts.  A player had experience, level, items&#8230; and not much else (in many of them, at any rate).  For something this simple, here is an approach that is at least as expressive, simpler, and easier to maintain.  Although the author is using Ruby, this example is written in newLisp (using contexts as dictionaries), because it is seldom wise to miss an opportunity to write something in newLisp ;)</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">;;; 'item is a hash of tables</span>
<span style="color: #66cc66;">&#40;</span>context 'items <span style="color: #ff0000;">&quot;sword&quot;</span> '<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>use <span style="color: #ff0000;">&quot;wielded&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>context 'items <span style="color: #ff0000;">&quot;chest-armor&quot;</span> '<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>use <span style="color: #ff0000;">&quot;torso&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>context 'items <span style="color: #ff0000;">&quot;leg-armor&quot;</span> '<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>use <span style="color: #ff0000;">&quot;lets&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;;; 'Player is a hash prototype. Defined using</span>
<span style="color: #808080; font-style: italic;">;;; this syntax for clarity and simplicity.</span>
<span style="color: #66cc66;">&#40;</span>context 'Player<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'inventory '<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'wielded <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'torso <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'legs <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>context MAIN<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;;; Player actions</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>own player item<span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;Adds item to player's inventory.&quot;</span>
  <span style="color: #66cc66;">&#40;</span>push item player<span style="color: #66cc66;">:</span><span style="color: #555;">inventory</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span>equip player item<span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;Equips an item from a player's inventory.&quot;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>find item <span style="color: #66cc66;">&#40;</span>context player <span style="color: #ff0000;">&quot;inventory&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span>
      <span style="color: #66cc66;">&#40;</span>context player <span style="color: #66cc66;">&#40;</span>lookup 'use
        <span style="color: #66cc66;">&#40;</span>context items <span style="color: #66cc66;">&#40;</span>string item<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> item<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>println <span style="color: #ff0000;">&quot;You equipped your &quot;</span> item<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>println <span style="color: #ff0000;">&quot;You have no &quot;</span> item<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;;; Now let's test it</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>new 'Player 'Joe<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>own Joe 'sword<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>equip Joe 'sword<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>equip Joe 'leg-armor<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Including whitespace, comments, and examples at the end, the example is 35 lines.  It also includes logic to verify that the player has an item in inventory and messages to the player in response to commands.  Not bad.  Expressive, efficient, and concise.  And, because this version does not require the replication of many very similar objects, we are not wasting memory and avoiding a lot of introspecting code to keeps everything aligned.</p>
<p>Albert Einstein said, &#8220;Everything should be made as simple as possible, but not simpler.&#8221;  OO is predicated on the concept of a program as a microcosm of the universe.  This puts a lot of responsibility on a programmer&#8217;s shoulders.  As a programmer, there is a tendency to want to create objects as extensible as possible; it becomes necessary to constrain each object to avoid unnecessary complexity.  In many instances, that sort of extensibility is like sand-blasting a soup cracker.  There are simpler abstraction techniques that reduce code complexity and redundancy and incidentally result in faster software.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F&amp;title=Avoiding+excess+redundancy" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F&amp;title=Avoiding+excess+redundancy" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Avoiding+excess+redundancy&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F&amp;title=Avoiding+excess+redundancy" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F&amp;title=Avoiding+excess+redundancy" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F&amp;title=Avoiding+excess+redundancy" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Avoiding+excess+redundancy+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Favoiding-excess-redundancy%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/avoiding-excess-redundancy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

