<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://united-coders.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>united-coders.com - functional</title>
 <link>http://united-coders.com/taxonomy/term/21/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Javascript Functional programming with Underscore or ECMAScript5</title>
 <link>http://united-coders.com/christian-harms/javascript-functional-programming-with-underscore-or-ecmascript5</link>
 <description>&lt;p&gt;Intro: A little excursion to code more functional with javascript. It contain examples with the classic for-loop-code, the more functional variant with &lt;a href=&quot;http://documentcloud.github.com/underscore/&quot; title=&quot;JavaScript helper Underscore&quot;&gt;Underscore.js&lt;/a&gt; and the HTML5 functional enhancements. It does not explain the basic idea of functional programming - it shows the differences in code examples.&lt;/p&gt;
&lt;h2&gt;motivation&lt;/h2&gt;
&lt;p&gt;Last week I got access on the address book from Matthias&#039; well known entry &lt;a href=&quot;http://united-coders.com/matthias-reuter/better-javascript-three-women-and-one-address-book&quot;&gt;Jennifer&lt;/a&gt;. But I had no time to scan all the other girls addresses. With many lines of source code filled with for-loop-code - no way. I have to find a smarter coding way to scan the address book.&lt;span class=&quot;read-more&quot;&gt;&lt;a href=&quot;/christian-harms/javascript-functional-programming-with-underscore-or-ecmascript5&quot;&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:trackback=&quot;http://madskills.com/public/xml/rss/module/trackback/&quot;&gt;
&lt;rdf:Description rdf:about=&quot;http://united-coders.com/christian-harms/javascript-functional-programming-with-underscore-or-ecmascript5&quot; dc:identifier=&quot;http://united-coders.com/christian-harms/javascript-functional-programming-with-underscore-or-ecmascript5&quot; dc:title=&quot;Javascript Functional programming with Underscore or ECMAScript5&quot; trackback:ping=&quot;http://united-coders.com/trackback/74&quot; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
&lt;div class=&#039;sexybookmarks-default-9616&#039;&gt;&lt;/div&gt;</description>
 <comments>http://united-coders.com/christian-harms/javascript-functional-programming-with-underscore-or-ecmascript5#comments</comments>
 <category domain="http://united-coders.com/category/tags/benchmark">benchmark</category>
 <category domain="http://united-coders.com/category/tags/ecmascript5">ecmascript5</category>
 <category domain="http://united-coders.com/category/tags/filter">filter</category>
 <category domain="http://united-coders.com/category/tags/functional">functional</category>
 <category domain="http://united-coders.com/category/tags/javascript">javascript</category>
 <category domain="http://united-coders.com/category/tags/map">map</category>
 <enclosure url="http://united-coders.com/sites/default/files/functional.js.txt" length="3236" type="text/plain" />
 <pubDate>Mon, 04 Oct 2010 19:56:21 +0000</pubDate>
 <dc:creator>Christian Harms</dc:creator>
 <guid isPermaLink="false">74 at http://united-coders.com</guid>
</item>
<item>
 <title>Functional programming with Python</title>
 <link>http://united-coders.com/christian-harms/functional-programming-with-python</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;To work with lists many c/c++ programmer use a simple for-loop. I will try to explain how this can be made a little bit easier. For that I use the self-explaining script language python.&lt;/p&gt;
&lt;p&gt;Here is a simple example to filter all odd integers from a list in simple &lt;b&gt;python 2.x&lt;/b&gt; syntax.&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;python geshifilter-python&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; filter_odd&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;myList&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;: &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;result = &lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# initialize the result list &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; num &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; myList: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# iterate over the list &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; num &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;2&lt;/span&gt; == &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# modulo 2 return 1 for odd integers&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.&lt;span style=&quot;color: black;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;num&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# add to the result&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; result &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/div&gt;&lt;span class=&quot;read-more&quot;&gt;&lt;a href=&quot;/christian-harms/functional-programming-with-python&quot;&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:trackback=&quot;http://madskills.com/public/xml/rss/module/trackback/&quot;&gt;
&lt;rdf:Description rdf:about=&quot;http://united-coders.com/christian-harms/functional-programming-with-python&quot; dc:identifier=&quot;http://united-coders.com/christian-harms/functional-programming-with-python&quot; dc:title=&quot;Functional programming with Python&quot; trackback:ping=&quot;http://united-coders.com/trackback/11&quot; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
&lt;div class=&#039;sexybookmarks-default-7237&#039;&gt;&lt;/div&gt;</description>
 <comments>http://united-coders.com/christian-harms/functional-programming-with-python#comments</comments>
 <category domain="http://united-coders.com/category/tags/filter">filter</category>
 <category domain="http://united-coders.com/category/tags/functional">functional</category>
 <category domain="http://united-coders.com/category/tags/list-comprehension">list comprehension</category>
 <category domain="http://united-coders.com/category/tags/map">map</category>
 <category domain="http://united-coders.com/category/tags/programming">programming</category>
 <category domain="http://united-coders.com/category/tags/python">python</category>
 <category domain="http://united-coders.com/category/tags/reduce">reduce</category>
 <pubDate>Mon, 30 Mar 2009 20:28:05 +0000</pubDate>
 <dc:creator>Christian Harms</dc:creator>
 <guid isPermaLink="false">11 at http://united-coders.com</guid>
</item>
</channel>
</rss>


