<?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>The Bloj &#187; Semantic Unit Architecture</title>
	<atom:link href="http://blog.strafenet.com/category/programming/semantic-unit-architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.strafenet.com</link>
	<description>is a GLOBAL mission focused, values based and demographics driven organization.</description>
	<lastBuildDate>Tue, 10 Aug 2010 04:27:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The New Programming (Part V): Semantic Units, Security and Debugging</title>
		<link>http://blog.strafenet.com/2006/09/01/the-new-programming-part-v-semantic-units-security-and-debugging/</link>
		<comments>http://blog.strafenet.com/2006/09/01/the-new-programming-part-v-semantic-units-security-and-debugging/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 05:39:19 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Chris]]></category>
		<category><![CDATA[Product Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Semantic Unit Architecture]]></category>

		<guid isPermaLink="false">http://blog.strafenet.com/2006/09/01/the-new-programming-part-v-semantic-units-security-and-debugging/</guid>
		<description><![CDATA[In this episode we&#8217;ll be talking about the crosscutting concerns of security and debugging.

Borrowed terminology
The idea of a crosscutting concern comes from aspect-oriented programming. In object-oriented and other kinds of programming, we often find that certain needs, logging and security being the most notable examples, appear in every object. If you want your program to [...]]]></description>
			<content:encoded><![CDATA[<p>In this episode we&#8217;ll be talking about the crosscutting concerns of security and debugging.</p>
<p><span id="more-477"></span></p>
<h2>Borrowed terminology</h2>
<p>The idea of a crosscutting concern comes from <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" title="Aspect-oriented programming">aspect-oriented programming</a>. In object-oriented and other kinds of programming, we often find that certain needs, logging and security being the most notable examples, appear in every object. If you want your program to keep a log, you will likely have logging elements all throughout your program, defying the notion of encapsulation.</p>
<p>In order to solve this problem, some forms of AOP use <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming#Join_Point_Models" title="Join points">join points</a>. Throughout the code of a Java program, <a href="http://en.wikipedia.org/wiki/AspectJ" title="AspectJ - aspect oriented Java">AspectJ</a> forms what one might call a type of <a href="http://en.wikipedia.org/wiki/Preprocessing" title="Preprocessing">preprocessing</a>; it inserts code into the program, called advice, whenever it appears appropriate (only at join points).</p>
<p>Unlike AOP, we make our abstractions at a high enough level that we can imagine using Units both as encapsulated objects <em>and</em> aspects.</p>
<h2>Security</h2>
<p>In our case, S-Unit defines security in terms of three major problems:</p>
<ol>
<li>How do we identify units? (unit authentication)</li>
<li>How do we identify users? (user authentication)</li>
<li>Under what circumstances do we restrict the use of units? (user/unit permissioning)</li>
</ol>
<p>Under these circumstances, we always begin with the first establishment of trust, just like in the real world. A user may choose to trust a unit. In order to make an informed decision, we must have a way of telling the user, verifiably, what the unit does.</p>
<p>This, in reality, would likely demand that we create signing authorities for units, and act as an authenticator. If we were a central authority, we could act as an independent 3rd party verifier to determine exactly what a unit did (its security risks, etc.). We&#8217;ll discuss this more when we talk about the Semantic Nexus, Semantwiki (Part IX).</p>
<p>In general, since we&#8217;re not an operating system, we have only a few ways to choose from as far as authenticating users. We can take operating system permissions and translate them as necessary, or we can operate as a user authenticator per machine (in effect, be our own permissions manager).</p>
<p>Unit restriction would be based on the intersection of information provided by these two authentications.</p>
<h2>Debugging</h2>
<p>The concern of <a href="http://en.wikipedia.org/wiki/Debugging" title="Debugging">debugging</a> is generally to figure out when and where a program has failed. The first thing we can do to make sure that debugging is simple is confine error processing to the unit of failure.</p>
<p>This of course, is not always possible. Rigorous S-Unit programming makes two (not necessarily provable) demands that would make this condition at least imaginable:</p>
<ol>
<li>A channel specifies a semantic data type which does not allow failure cases (i.e. cases that contain data that results in error)</li>
<li>By accepting a channel, the unit makes a contract to process every possible message that could appear in that channel viably.</li>
</ol>
<h2>Enforcing the first condition: Semantic Message Validation</h2>
<p>In order to validate messages coming in and out of a unit, we must know exactly what data we expect and additionally have rules that confirm this data. It&#8217;s a challenge to fit this sort of validation into semantic data; if we say, for example, that an IM message can only be under 4096 characters, we need to add this rule and apply it ourselves. The Semantic Web group, for example, is only interested in adding semantic meanings to data&#8211;not restricting or validating that data. We&#8217;ll discuss how to attach this validation to semantic data in Parts VI and VII.</p>
<h2>Enforcing the second condition: Unit Contract Validation</h2>
<p>The only way to guarantee absolutely that a unit can process all possible inputs is to test all possible inputs. Given that this is unlikely, we can still create a Tester unit, which offers to try a series of random inputs and see if a failure is thrown in any case.</p>
<p>A Tester Unit is unique in that we probably can&#8217;t imagine attaching it to live applications, which already produce test cases simply by running. Given these conditions, we can limit the number of errors we receive to <em>primarily</em> single-unit errors. How might we diagnose them?</p>
<h2>Debugger-Unit</h2>
<p>The solution, as you might imagine, is a new unit. The Debugger can attach to every other Unit and can watch variables and keep breakpoints.</p>
<p>This unit, given the architecture of the semantic system, will be unusual in several ways compared to a normal debugger. It will only report breakpoints in its unit; other units will be free to continue operating (unless they are of course attached to the debugger). Another challenge is that, with language-independent units, it will be difficult to develop a true debugger; it will depend very much on compilation techniques, which will receive a more rigorous treatment in Part VI when we discuss languages.</p>
<h2>Related links:</h2>
<p>http://www-128.ibm.com/developerworks/web/library/wa-debug.html?ca=dgr-lnxw03Dbug</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.strafenet.com/2006/09/01/the-new-programming-part-v-semantic-units-security-and-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New Programming (Part IV): Semantic Unit Architecture (S-Unit), Unit Structure Language</title>
		<link>http://blog.strafenet.com/2006/08/31/the-new-programming-part-iv-semantic-unit-architecture-s-unit-unit-structure-language/</link>
		<comments>http://blog.strafenet.com/2006/08/31/the-new-programming-part-iv-semantic-unit-architecture-s-unit-unit-structure-language/#comments</comments>
		<pubDate>Thu, 31 Aug 2006 04:14:17 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Chris]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Semantic Unit Architecture]]></category>

		<guid isPermaLink="false">http://blog.strafenet.com/2006/08/31/the-new-programming-part-iv-semantic-unit-architecture-s-unit-unit-structure-language/</guid>
		<description><![CDATA[&#8220;once i stop changing the name, we&#8217;ll know i&#8217;ve figured out what it is&#8221;
So, in my last entry, I drew a nice diagram that purported to explain exactly how this so called Unit Architecture would be constructed; however, I neglected to have real code to back it up.
How would a Unit be coded? Basically, all [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;once i stop changing the name, we&#8217;ll know i&#8217;ve figured out what it is&#8221;</p></blockquote>
<p>So, in my last entry, I drew a nice diagram that purported to explain exactly how this so called Unit Architecture would be constructed; however, I neglected to have real code to back it up.</p>
<p>How would a Unit be coded? Basically, all a Unit has to expose to the outside world is an interface that lists the semantic types it deals with.</p>
<p><span id="more-475"></span></p>
<p><img src="http://blog.strafenet.com/wp-content/uploads/2006/08/Flywire%20Project1.png" alt="IM Client Diagram" id="image474" /></p>
<p>The LinkToIMNetwork specifies 4 interfaces and is basically event-driven. If I update my connection settings (i.e. pick a new server or something), the Human unit sends a message that gets received by ConnectionManager. Want to guess what channel that event goes through? Yup, UserInput.</p>
<p>The ConnectionManager then sends a message through the ConnectionSettings channel to LinkToIMNetwork. We can imagine that these messages can either be handled sequentially or concurrently, and it won&#8217;t make much of a difference, syntactically speaking.<br />
If we were to pseudocode the UserList unit, we might see something like the following (note: Wordpress can&#8217;t indent):</p>
<blockquote>
<pre>Unit UserList:
---Channels Out:
-------UserInterface
---Channels In:
-------ListofUsers
------UserInput</pre>
</blockquote>
<p>In each of the In channels, we&#8217;d have to specify how to handle an incoming message. This would be exactly one function, in a language yet to be described. In the out channels, we&#8217;d need a way of identifying what sort of semantic data the system would output; in the in channels, we&#8217;d need a way of specifying what kinds of semantic data the system would accept (this might allow more than one fit!).</p>
<p>Next episode, we&#8217;ll talk about fundamental design concerns that one might call aspects (security, debugging). In Part VI, we&#8217;ll talk about the language we might use to handle the incoming messages; its design requirements, and possible fits.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.strafenet.com/2006/08/31/the-new-programming-part-iv-semantic-unit-architecture-s-unit-unit-structure-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New Programming (Part III): Semantic Unit Architecture, Messaging Framework</title>
		<link>http://blog.strafenet.com/2006/08/30/the-new-programming-part-iii-semantic-unit-architecture-messaging-framework/</link>
		<comments>http://blog.strafenet.com/2006/08/30/the-new-programming-part-iii-semantic-unit-architecture-messaging-framework/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 18:14:12 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Chris]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Semantic Unit Architecture]]></category>

		<guid isPermaLink="false">http://blog.strafenet.com/2006/08/30/the-new-programming-part-iii-semantic-unit-architecture-messaging-framework/</guid>
		<description><![CDATA[So in the past, I promised that I&#8217;d discuss how we&#8217;d get these objects to communicate with each other. Exactly how would a user list know how to handle its connection to an instant messaging manager?
Before we do this, we&#8217;ll go into a brief interlude to see MS&#8217;s solution to this problem.

Google&#8217;s Theorem: It&#8217;s already [...]]]></description>
			<content:encoded><![CDATA[<p>So in the <a href="http://blog.strafenet.com/2006/08/28/the-new-programming-part-i-functional-procedural-object-oriented-programming-fpoop/" title="The Birth of SUA/FOOP">past</a>, I promised that I&#8217;d discuss how we&#8217;d get these objects to communicate with each other. Exactly how would a user list know how to handle its connection to an instant messaging manager?</p>
<p>Before we do this, we&#8217;ll go into a brief interlude to see MS&#8217;s solution to this problem.</p>
<p><span id="more-471"></span></p>
<h2>Google&#8217;s Theorem: It&#8217;s already been done</h2>
<p>After Gas finally figured out what I was doing, he mentioned that MS had already done this sort of semantic architecture:</p>
<blockquote><p>[00:20] Gas: Microsofts version of the semantic operating system<br />
[00:20] Gas: is the clipboard<br />
[00:20] Gas: (you think i&#8217;m joking?)</p></blockquote>
<p>Gas was correct that the linking system, in many ways, is solving a similar problem to the clipboard. How do you take a piece of data and give it meaning? The Clipboard uses <a href="http://www.avdf.com/aug96/art_ole.html" title="OLE: low level">OLE</a> to translate data formats, allowing us to <a href="http://www.winplanet.com/article/1861-.htm" title="OLE in practice">paste</a>, say, an Excel spreadsheet into a Word document and have it be displayable.</p>
<p>This isn&#8217;t the only example of being able to plug data into an system and give it meaning. The Semantic Web is based around the idea of being able to attach meanings to data. For example, this page is a blog entry &#8211; the Semantic Web would be able to assign meanings to this beyond simple character data, identifying entries, authors, and the like.</p>
<h2>Back to the fun</h2>
<p>We are not thinking here purely of the Semantic Web, but rather, a Semantic Web Application&#8211;architecture that processes this data. This is in some senses a much simpler problem&#8211;we need only deal with subsets of data which are viable.</p>
<p>Similarly, we are not dealing purely with an <a href="http://rayozzie.spaces.live.com/blog/cns!FB3017FBB9B2E142!285.entry" title="Live Clipboard - look for it!">advanced clipboard</a>. Clipboards hold repositories of data and join it together&#8211;we are in fact actually processing that data.</p>
<p>Let&#8217;s imagine a series of Units that build an Instant Messaging client. We&#8217;ll have a LinkToIMNetwork, a UserList, a ConnectionManager, and the Human unit (refer to previous entry).</p>
<p><img src="http://blog.strafenet.com/wp-content/uploads/2006/08/Flywire%20Project1.png" alt="IM Client Diagram" id="image474" /><br />
You&#8217;ll notice, if you&#8217;re familiar with UML in other object oriented languages, that there is a&#8211;surprising? disturbing? exciting?&#8211;lack of type definition in the relationships. All of the units are peers, and there is no aggregation, no subclassing, no nothing. Nowhere do we define a list of methods, and nowhere do we have to specify types by hand. <em>This is exactly what we want if we want a chance of giving the average person an ability to understand the architecture.</em></p>
<p>For every channel in one unit, we&#8217;ll notice a matching channel in another. LinkToIMNetwork passes a ListofUsers to UserList. Because these types are defined as output and input in the two units, connecting the two requires no effort on our part&#8211;the linking engine will know what to pass a ListOfUsers, and not anything else.</p>
<p><strong>What happens if there&#8217;s ambiguity in the connection?</strong></p>
<p>This will be defined behavior. My initial intuition is to do a multicast. For example, if you connect two UserLists to a LinkToIMNetwork, it will pass the ListofUsers to both.</p>
<p>Reversedly, we can imagine UserList accepting multiple ListsofUsers and aggregating them together. We could have LinkToAIMNetwork and LinkToGoogleNetwork, for example, and plug them both in to UserList.</p>
<p><strong>Won&#8217;t this demand a lot of functionality on the part of units?</strong></p>
<p>Yes, only programmers are expected to touch the innards of units, for now at least.</p>
<p><strong>You seem to have ignored a lot of important details&#8211;you haven&#8217;t touched the ConnectionStatus, for example.</strong></p>
<p>Yeah, I did a half-baked job.</p>
<p><strong>This may give the average user an ability to look at the architecture, but how would they manipulate it? There doesn&#8217;t appear to be much room for user intervention.</strong></p>
<p>This depends on a lot of factors. Basically, the more units we have, the more effective (by exponential leaps and bounds) will be the use of the FOOP tool. On one level, we could simply upgrade units&#8211;proper upgrading of the LinkToIMNetwork might enable file transfers with less effort than might be typically anticipated. On another level, we could attach units in any way that was semantically allowed, and with expansively defined units, we could make disturbingly good applications out of previously unrelated units.</p>
<p>Tune in next time, when we&#8217;ll discuss how we might syntactify such a language.</p>
<h2>Related Info</h2>
<p><a href="http://en.wikipedia.org/wiki/Component_object_model" title="Component Object Model">http://en.wikipedia.org/wiki/Component_object_model</a></p>
<p><a href="http://www.w3.org/TR/owl-guide" title="OWL">http://www.w3.org/TR/owl-guide</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.strafenet.com/2006/08/30/the-new-programming-part-iii-semantic-unit-architecture-messaging-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New Programming (Part II): Functional Object-Oriented Programming (FOOP)</title>
		<link>http://blog.strafenet.com/2006/08/29/the-new-programming-part-ii-functional-object-oriented-programming-foop/</link>
		<comments>http://blog.strafenet.com/2006/08/29/the-new-programming-part-ii-functional-object-oriented-programming-foop/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 04:09:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Chris]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Semantic Unit Architecture]]></category>

		<guid isPermaLink="false">http://blog.strafenet.com/2006/08/29/the-new-programming-part-ii-functional-object-oriented-programming-foop/</guid>
		<description><![CDATA[In my last post, I issued a longish essay that proved that I am equally incompetent in my comprehension of functional and object-oriented programming. We created the notion of a unit, an entity that behaves somewhat like an object&#8211;it can be stateful, it defines a space which belongs to it&#8211;and somewhat like a function&#8211;well, it [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post, I issued a longish essay that proved that I am equally incompetent in my comprehension of functional and object-oriented programming. We created the notion of a <em>unit</em>, an entity that behaves somewhat like an object&#8211;it can be stateful, it defines a space which belongs to it&#8211;and somewhat like a function&#8211;well, it doesn&#8217;t really.</p>
<p>Or does it? Hopefully the example we choose will clarify some aspects of how this method differs from standard development techniques.</p>
<p><span id="more-470"></span></p>
<p><strong>The Human Unit</strong></p>
<p>One of the quirky parts of programming is dealing with humans. This is no surprise&#8211;programming languages aren&#8217;t human oriented. It&#8217;s easy to sort a list of items in most languages. However in most programs, there is an awkward moment where we call the program into existance. In C, it&#8217;s called main. In Python, there&#8217;s a whole blog <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=4829" title="Python main() functions">entry</a> by the creator of Python dedicated to it.</p>
<p>With a graphical UI, the challenges seemingly multiply. Computer programming is (typically) a sequential art; things work simplest when one thing follows another. In a (good) graphical UI, the user never waits for the computer to finish; output can come in many forms at many times.</p>
<p>A Human unit is a rather versatile unit to connect to. It works well in the unit scheme because we can connect it to other entities rather simply, in some cases. If we connect &#8220;Hello, World!,&#8221; a Text unit, to the Human, the output would appear on their screen. If we connect an MP3, the Human would hear the MP3.</p>
<p><img src="http://blog.strafenet.com/wp-content/uploads/2006/08/Example.png" alt="Connections diagram" id="image476" /><br />
How would the system know how to handle connections to Human? This would be a matter of the system understanding the connected unit on a semantic level. We could imagine a semantic attribute being assigned to all values that defines its human interaction.</p>
<p><strong>A Matter of Semantics</strong></p>
<p>Semantic attributes would also allow us a measure of freedom in attaching objects to each other. If we attach a Printer to a Web Browser, we don&#8217;t need to tell the Printer to print the web page and not the address of the page it&#8217;s currently on.</p>
<p><strong>Is a connection forever?</strong></p>
<p>The previous Printer example seems to suggest that connections don&#8217;t remain the same in time. Would we want to script connections to open and close? This is one of the many ridiculous challenges I seem to have written myself into.</p>
<p><strong>Is this a useful method of getting people involved in programming, or just a useful way of visualizing architecture?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.strafenet.com/2006/08/29/the-new-programming-part-ii-functional-object-oriented-programming-foop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New Programming (Part I): Functional Object-Oriented Programming (FOOP)</title>
		<link>http://blog.strafenet.com/2006/08/28/the-new-programming-part-i-functional-procedural-object-oriented-programming-fpoop/</link>
		<comments>http://blog.strafenet.com/2006/08/28/the-new-programming-part-i-functional-procedural-object-oriented-programming-fpoop/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 22:02:50 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Chris]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Semantic Unit Architecture]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://blog.strafenet.com/2006/08/28/the-new-programming-part-i-functional-procedural-object-oriented-programming-fpoop/</guid>
		<description><![CDATA[In my last post, &#8220;Free as in speech, not as in beer,&#8221; I made the rather outlandish claim that open source software will not truly live up to its arrogant claims of freedom until there is freedom for everyone; that everyone with the wit and ambition would be able to understand how software was constructed [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post, &#8220;<a href="http://blog.strafenet.com/2006/08/26/free-as-in-speech-not-as-in-beer/" title="Free as in speech, not as in beer">Free as in speech, not as in beer</a>,&#8221; I made the rather outlandish claim that open source software will not truly live up to its arrogant claims of freedom until there is freedom for <em>everyone</em>; that everyone with the wit and ambition would be able to understand how software was constructed and even be able to manipulate the code themselves. Now you may argue with me that making software architecture this simple is downright impossible when <a href="http://www.codinghorror.com/blog/archives/000635.html" title="Separating Programming Sheep from Non-Programming Goats">30-60% of university students fail their first programming course</a>. And you may be right; I didn&#8217;t set a goal based on its achievability.</p>
<p>But it would be silly to give up on a goal with such a wide potential. In fact, I&#8217;m going to go ahead and tool a new paradigm of software architecture. To some extent, we have the pieces we need; all that&#8217;s needed is a bit (lot) of imagination and hard work.</p>
<p>We can summarize this in three main points:</p>
<ol>
<li>Programs should be made of individual components that can be easily understood.</li>
<li>Components should be able to function independently; we should not have to guide them. Instead, they should have well-defined behaviors.</li>
<li>Components should be able to handle all sorts of input.</li>
</ol>
<p><span id="more-469"></span></p>
<h2>1. You may not know why the phosphors glow&#8230;but you can change the channels.</h2>
<p>A program is made up of a set of working components, much like televisions, cars and any other man made object.</p>
<p>Most of us don&#8217;t know exactly how TVs work. We don&#8217;t know how to build a cathode ray tube. But we know it&#8217;s in there, we know how to change the channels, we know that it has a standard plug that can hook up to any cable outlet.</p>
<p><strong>This is what&#8217;s missing in an average computer program.</strong></p>
<blockquote><p>Run a web browser. The browser is one seamless block of code; you can&#8217;t say exactly which part is displaying the page, or which part is retrieving it. If you think this is silly/wrong, think about this; many average computer users don&#8217;t even understand that there&#8217;s a browser at all. They just think of it as the &#8220;internet.&#8221; This is lexical nonsense!</p>
<p>But we don&#8217;t build software so that the concepts programmers see are also clear to the user.</p></blockquote>
<h2>2. Functional Object-Oriented Programming (FOOP)</h2>
<p>When we talk about <em>object oriented programming</em>, we&#8217;re usually referring to a programming language like Java or Smalltalk. In Java, <em>objects </em>are individual entities that all follow the behavior of the class that spawned them. For example, we can create many Waiter objects based on a Waiter <em>class</em>. The Waiter class tells us that Waiter objects can take orders and remember them. You might imagine a Waiter object having these methods, as dictated to the Waiter by the class:</p>
<blockquote><p>1. takeOrder(x) //This means, &#8220;Waiter, please get us x!&#8221;</p>
<p>2. getStatus(x) //This means, &#8220;Waiter, tell us how our x is doing. Is it ready?&#8221;</p></blockquote>
<p>Each of these takes an input (that&#8217;s called x) and gives us a response. Every Waiter object responds to these method calls.</p>
<p>Now in a way, this model is very intuitive; we can picture an imaginative 9 year old thinking of Waiters as Waiter objects. He or she could read through the Waiter&#8217;s 2 methods and call them, making the Waiter takeOrders for every food imaginable until the table was full. The reason this method works well is that it revolves around an object &#8211; a Waiter &#8211; for which we have a good cognitive model; we know what waiters are and how they function.</p>
<p>What we really want, however, is a more advanced idea of an object. If you give a Waiter an order, they should know what to do with it. <em>We shouldn&#8217;t have to call takeOrder at all</em>. This may sound silly, but <em>in the real world we expect not to clear the hurdles of going through a Waiter&#8217;s <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#method_summary" title="Javadoc madness">javadoc</a> and figuring out exactly which method of two hundred to call</em>. In order to have truly intuitive programming, we shouldn&#8217;t have to be aware of this extraneous information&#8211;passing a Waiter an order should just be that.</p>
<h2>Make Objects Know What to Do on Their Own!</h2>
<p>In order for this to be, we can replace the idea of an object with something more akin to functions in functional programming. While so far we have made objects the primary unit of programming, now we will examine the use of &#8220;functions.&#8221;</p>
<p>Gas <a href="http://blog.strafenet.com/2005/12/20/the-beauty-of-anonymous-methods-aka-lambda-expressions/" title="Tim's take on lambda">discusses</a> this when he referred to the concept of <a href="http://en.wikipedia.org/wiki/Lambda_calculus" title="Lambda calculus">lambda calculus</a> and functions as first order values. (You may be more familiar with Joel on Software&#8217;s <a href="http://www.joelonsoftware.com/items/2006/08/01.html" title="Can Your Programming Language Do This?">example</a>.) We&#8217;re not going to go into lambda calculus, so you can ignore this and read the following:</p>
<blockquote><p>A function doesn&#8217;t have to be <em>told</em> what to do when given an input; instead, it <em>knows.</em> Unlike objects, functions are defined by the output they produce for a particular input.</p></blockquote>
<p>The basic <em>unit </em>I&#8217;m developing here is neither a true object nor a traditional function. A traditional object offers more than one way to process data; ours simply accepts data in any form. True functional programming, on the other hand, does not have objects with state (think waiting algorithm, not waiter); its functions are immutable, while we potentially allow units to remember things by having state.</p>
<h2>3. Polymorphism: The Universal Translator</h2>
<p><a href="http://en.wikipedia.org/wiki/Polymorphism_(computer_science)" title="Polymorphism">Polymorphism</a>, for us, basically means that our unit can understand any sort of input it is given.  When you think in a language like C, you generally restrict the input you can process. A function called add in C would be able to add only what it was defined to add. If it was defined for integers, it wouldn&#8217;t be able to add fractions or strings, and vice versa.</p>
<p>To create units that anyone would be able to combine in a way that made sense to them, we would have to make this distinction <em>entirely </em>invisible to the user. This is the reason that in Javascript, you can add &#8220;abc&#8221; and 123 to get &#8220;abc123&#8243;&#8211;addition in JS is polymorphic, able to handle different types.</p>
<p>Now, in order for our unit to be able to handle being thrown all sorts of strange data, we must give that unit some sort of understanding of what the data is. An image, for example, is just a number when we store it on a computer; however that does not mean that when we add two images together we just want to add the two underlying numbers!</p>
<p>This is an extremely challenging problem, and there are two main ways we can tackle it; give each unit the ability to handle all new types of data, or encode in each piece of data some sort of semantic meaning. In the end we may find that both are important; this is a challenge I will address in more detail in Part III.</p>
<p>In Part II, we&#8217;ll talk about a concrete example of this unit architecture and also show how we might get a human involved in this process.</p>
<h2>Conclusions</h2>
<p>If you just look at the rules of the system, without looking at the overarching goals, you might confuse the system I have just devised with a sort of lawless type-unsafe Javascript. In a way, I&#8217;m not too unhappy with that definition; if you ask the average math student to add two numbers, they won&#8217;t return an error if you give them a fraction and a complex function as the two things to add. (and if they do, they probably won&#8217;t make it past their sophomore year.) <strong>The point of erasing all these arbitrary distinctions is to remove the unnecessary burdens with which the average person is encumbered when learning to program.</strong></p>
<p>If I took an experienced programmer, and faced them with the implications of my strange unit system, they would likely stick to Lisp or Java or C, and that&#8217;s fine. <strong>The goal here is to show the average person how to produce useful software without thinking about syntax, type safety, or error handling, even once. Remember the TV!</strong> Hopefully, if this becomes clear, then FOOP might demonstrate its worth to power users.</p>
<p>[Ideas with similar visual modeling have made it into big company research projects - see <a href="http://www.jumpcut.com/fullscreen?id=594F555C568011DC9D24000423CEF5B0&amp;type=movie">here</a>!]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.strafenet.com/2006/08/28/the-new-programming-part-i-functional-procedural-object-oriented-programming-fpoop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.394 seconds -->
