<?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>Advent Digerati &#187; Javascript</title>
	<atom:link href="http://blog.adventdigerati.com/category/software/languages/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adventdigerati.com</link>
	<description>Where Life meets Geek</description>
	<lastBuildDate>Mon, 26 Jul 2010 00:49:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Get Functional</title>
		<link>http://blog.adventdigerati.com/2010/07/get-functional/</link>
		<comments>http://blog.adventdigerati.com/2010/07/get-functional/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 01:41:44 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.adventdigerati.com/?p=73</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div style=text-align:center;font-style:italic;font-size:14px;">Sorry for the absence, it&#8217;s been a long road getting back here.</p>
<p>I hope you enjoy the ride.</p></div>
<p>Recently I&#8217;ve become fascinated with the concept of functional programming. For several years, I&#8217;ve had friends jump from language to language, but they all seem to settle on the functional side of the fence. &#8220;Why?&#8221; was the inevitable conundrum. For the longest time I couldn&#8217;t understand what it had to offer that you couldn&#8217;t do in other languages. Like most programming phenomena, it was an epiphanic moment that changed the way I looked at programming for the better forever.<br />
<span id="more-73"></span></p>
<h2>Code is Data; Data is Code</h2>
<p>Ok, omgwthbbq does <i>this</i> mean? How is code parseable data? How is data trustable code? For this, I had to rethink my stance on what makes a program an executable, not where the program comes from; it&#8217;s a cart-before-the-horse thing. So what makes a program? A program is executed lines of human-readable text compiled or interpreted but just the same converted into machine code before the processor reads the 1&#8242;s and 0&#8242;s from one stream and pushes a different set of 1&#8242;s and 0&#8242;s into another stream. Who cares how those lines got there. Could be from hand-entry, or it could be from a variable.<br />
<u>Epiphany the First: Who cares where we get code as long as it&#8217;s the right code we need?</u><br />
PHP has this: variable function names, <code lang="php">eval()</code>, <code lang="php">call_user_func()</code>. After you start coding using these patterns, it becomes nearly impossible to think otherwise. All of a sudden, &#8220;Gee, it would be so much easier if we could just tell functionY about functionX without having to teach classB about classA.&#8221; We stop thinking in terms of step-by-grudging-step and into segmented solutions to problems. When we can just <i>pass a function</i> into <code lang="php">functionY</code> of <code lang="php">classB</code>, this problem disappears. <code lang="php">classB</code> doesn&#8217;t have to give one darn about <code lang="php">classA</code>, just that when it needs to, it can use <code lang="php">functionX</code> and the world will keep on spinning.<br />
<u>Epiphany the Second: What data can I trust?</u><br />
Well, you can trust mine, silly! After all, I wrote it. Ah, so data doesn&#8217;t <i>have</i> to come from the user, it&#8217;s just a way of saying the A&#8217;s and underscores I put into the program can be used to reference other parts of the program without explicitly teaching them about each other. Data can come from anywhere, even code; and code can be executed from anything (with the right compiler/interpreter) including data.</p>
<p>Hopefully, this will spawn my first Git repository. Stay tuned for the linky!</p>
<p>[Edit July 7] Instead of a full-fledged repo, I just threw the PHP code up on <a href="http://bit.ly/9pyOh8" title="Gist">gist.github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adventdigerati.com/2010/07/get-functional/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

