<?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>Monomorphic &#187; reuse</title>
	<atom:link href="http://www.monomorphic.org/wordpress/tag/reuse/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.monomorphic.org/wordpress</link>
	<description>Nystrom re-presents</description>
	<lastBuildDate>Tue, 27 Jul 2010 02:12:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Doing generality right</title>
		<link>http://www.monomorphic.org/wordpress/doing-generality-right/</link>
		<comments>http://www.monomorphic.org/wordpress/doing-generality-right/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 02:00:02 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[HCI]]></category>
		<category><![CDATA[platforms]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[smalltalk]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=558</guid>
		<description><![CDATA[Many software developers, while making a tool to solve a specific problem, heed the siren call of generality. By making a few specific changes, they can turn the tool into a general framework for solving a larger class of problems. And then, with a few more changes, an even larger class of problems, and so [...]]]></description>
			<content:encoded><![CDATA[<p>Many software developers, while making a tool to solve a specific problem, heed the siren call of generality. By making a few specific changes, they can turn the tool into a general framework for solving a larger class of problems. And then, with a few more changes, an even larger class of problems, and so on. This often turns into a trap, and there is a risk that the end of the line is an over-generalised tool that isn&#8217;t very good at solving any problem, because the specificity that was present in the first place was part of why it was powerful. In this way, constraints can equal freedom.</p>
<p>Sometimes, though, the generalizers get it right. These are often moments of exceptional and lasting innovation. One example of such a system is the fabulously influential (but today, not that widely used) programming language <a href="http://www.smalltalk.org">Smalltalk</a>. Invented by the former jazz guitarist and subsequent Turing award winner <a href="http://en.wikipedia.org/wiki/Alan_Kay">Alan Kay</a>, Smalltalk was released as one of the first true object-oriented programming languages in 1980. It is probably still ahead of its time. It runs on a virtual machine, it has reflection, everything is an object, and the separation between applications is blurred in favour of a big object box. On running <a href="http://www.squeak.org/">Squeak</a>, a popular Smalltalk implementation, with its default system image today, users discover that all the objects on the screen, including the IDE to develop and debug objects, appear to follow the same rules. No objects seem to have special privileges.</p>
<p>Another such system is an application that used to be shipped on Mac computers in the distant past, <a href="http://en.wikipedia.org/wiki/HyperCard">Hypercard</a>. Hypercard enabled ordinary users to create highly customized software using the idea of filing cards in a drawer as the underlying model, blurring the line between end users and developers through its accessibility. I haven&#8217;t had the privilege to use it myself, but it seems like this was as powerful as it was because it served up a homogenous and familiar model, where everything was a card, and yet the cards had considerable scope for modification and special features. Even though, in some ways, this system appears to be a database, the cards didn&#8217;t need to have the same format, for instance. (Are we seeing this particular idea being recycled in a more enterprisey form in <a href="http://couchdb.apache.org/">CouchDB</a>?)</p>
<p>There are more examples of successful highly general design: the Unix file system, TCP/IP sockets and so on. They all have in common that they are easy to think about as a mental model, since a universal set of rules apply to all objects, they scale well in different directions when used for different purposes, and they give the user a satisfying sense of empowerment, <a href="http://www.monomorphic.org/wordpress/making-playtime-useful-with-color-filling-games/">blurring the line between work and play</a> to draw on the user&#8217;s natural creativity. Successful general systems are the ones that can be easily applied in quite varied situations without tearing in the seams.</p>
<p>While not widely used by industrial programmers today, Smalltalk was incredibly influential. In 1981 Objective-C was created by Brad Cox and Tom Love, directly inspired by what the Smalltalk designers had done. Objective-C was subsequently used as the language of choice for NeXTStep, and later for Apple&#8217;s MacOS X when Apple bought NeXT. Today it&#8217;s seeing a big surge in popularity thanks to devices like the iPhone, on which it is also used. In 1995 Java was introduced, owing a great deal of its design to Objective-C, but also introducing features such as a universal virtual machine and garbage collection, which Objective-C didn&#8217;t have at the time. In some sense, both Objective-C and Java are blends of the C-family languages and Smalltalk. Tongue in cheek, we might say that it seems evolution in industrial programming these days consists of finding blends that contain less of the C model and more of smalltalk or functional programming.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/doing-generality-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A wikipedia of algorithms</title>
		<link>http://www.monomorphic.org/wordpress/a-wikipedia-of-algorithms/</link>
		<comments>http://www.monomorphic.org/wordpress/a-wikipedia-of-algorithms/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 01:21:52 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=429</guid>
		<description><![CDATA[Here&#8217;s something I&#8217;ve wanted to see for some time, but probably don&#8217;t have time to work on myself. It would be nice if there was a wikipedia-like web site for code and algorithms. Just the common ones to start with, but perhaps more specialised ones over time. Of course the algorithms should be available in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something I&#8217;ve wanted to see for some time, but probably don&#8217;t have time to work on myself.</p>
<p>It would be nice if there was a wikipedia-like web site for code and algorithms. Just the common ones to start with, but perhaps more specialised ones over time. Of course the algorithms should be available in lots of different languages. This would in fact be one of the main points, so that people could compare good style and see how things should be done for different languages. In addition, there should be an in-browser editor, just like on Wikipedia (but perhaps with syntax highlighting) so people can make changes easily.</p>
<p>Furthermore, there should be unit tests for every algorithm, and these should be user-editable in the same way as the main code. In an ideal world, the web site would automatically run the unit tests every time there&#8217;s a change to some algorithm and check in a new version of the code to a versioned repository. People could then trust with reasonable confidence that the code is valid and safe. However, if the system were to be as open as Wikipedia is, such a system wouldn&#8217;t work, since users could write unit tests with malicious code. So I suspect volunteers would have to download, inspect, and run the unit tests regularly, and perhaps there would be a meta-moderation system of some kind, allowing senior members to promote changes to the official repository. In the meantime, everybody should be allowed to see and edit changes on the wiki immediately, but they would be marked as &#8220;untested&#8221; or &#8220;unsafe&#8221;.</p>
<p>User interface would be very important since this kind of site needs to be fun and easy to use regularly.</p>
<p>Has this kind of project already been carried out by someone? I can find some things by googling. <a href="http://www.thecodewiki.com/">The Code Wiki</a> appears to once have been a wikipedia of code, but it seems defunct, C# only, and now they&#8217;re selling a book with the contents of the site! <a href="http://www.algorithm-code.com/">Algorithm Wiki</a> has many algorithms in different languages, but the user interface is awkward and littered with obstructive advertising, the code is hard to browse, and it doesn&#8217;t make for a usable quick reference. They seem to have gotten off to a good start though. Any others?</p>
<p>Edit: <a href="http://rosettacode.org/wiki/Main_Page">Rosetta Code</a> seems to be the most mature and useful such site out there today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/a-wikipedia-of-algorithms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The problem with standards</title>
		<link>http://www.monomorphic.org/wordpress/the-problem-with-standards/</link>
		<comments>http://www.monomorphic.org/wordpress/the-problem-with-standards/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 23:52:01 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[ontologies]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=41</guid>
		<description><![CDATA[Standardised formats are essential to connections in the digital society. On the hardware side, USB is so ubiquitous and well defined that I can connect essentially any peripheral to any PC. In many cases I can even expect them to work without drivers. For sound, the 3.5 mm headphone plug has been ubiquitous as long [...]]]></description>
			<content:encoded><![CDATA[<p>Standardised formats are essential to connections in the digital society. On the hardware side, USB is so ubiquitous and well defined that I can connect essentially any peripheral to any PC. In many cases I can even expect them to work without drivers. For sound, the 3.5 mm headphone plug has been ubiquitous as long as I can remember. For video, there is VGA, DVI, and so on. Even if some of these change every now and then, we can always buy converters to convert from one format to another. The changes happen infrequently enough that this is a bearable burden.</p>
<p>On the software side, from a user perspective, it gets tougher. In terms of document formats, everybody is expected to have a web browser, to be able to read PDF documents, and to play MP3 files. There&#8217;s also a certain expectation that people can read and edit Microsoft Office documents, but in general, unless people have Microsoft Office itself, they are likely to use some program that does an imperfect job of converting to and from the office formats. More exotic formats people do not expect to share unless they know that the receiver has the same software.</p>
<p>One of the worst situations (and maybe one of the sources of these troubles) is software architecture. To look at just one subset of this universe, let&#8217;s consider some popular Java frameworks. There are many Java frameworks. I can think of Struts, Spring, Enterprise JavaBeans, Tomcat, JBoss, Websphere, OSGI. Each one is trying to be a universal, or near universal, component based framework for large scale Java applications. (Some of these are intended specifically for web applications, but the distinction is a bit arbitrary these days). Each one defines a particular behaviour and API that its users need to fit into.</p>
<p>One problem is that once you&#8217;ve developed your application in one of these frameworks, it&#8217;s tough to move to a different one. At best it&#8217;s &#8220;just&#8221; a matter of using a different API. At worst, the new framework has different expectations of component behaviour and forces you to either refactor your old application majorly or write lots of adapters.</p>
<p>Software has this particular kind of stickiness: objects designed in one context tend to be difficult or impossible to move to other contexts. Here are some problems brought about by this fact:</p>
<ul>
<li>Across several different devices and services, I have many different lists of my various contacts. For instance, I have an address book on my computer, which fortunately is shared with my iPhone. However, there&#8217;s also a list that Gmail maintains, one list on MSN messenger, one on ICQ, one on Facebook, one on the Playstation Network&#8230; etc. In a world with perfect software, I would have a single contact list that could be updated and accessed from any of these services (and I would still be able to selectively hide things from any one service, if I wanted to).</li>
<li>Most social networks support some kind of status update feature (Twitter, Facebook, &#8230;) but they generally can&#8217;t share this information with each other. There&#8217;s a tool called <a href="http://ping.fm">ping.fm</a> which is able to update lots of networks at once, but this is just for a single feature. And it took a third party tool to do it. And I have to give it all of my logins and passwords.</li>
<li>The health care systems in many countries are a mess (UK&#8217;s NHS and probably most US systems fall in this category). Different medical offices in different medical IT systems establish different journals, but they have no way of sharing the journal if the patient wants to use a different care provider. As experiences in the UK showed, achieving the ability to share these records can be very difficult sometimes.</li>
</ul>
<p>So how can we design really future proof standards? Here are my intuitive, unqualified answers:</p>
<p><em>Favor openness over closedness</em>. Allow unknown entities to enter your protocol at many different stages and in many different roles. Even if you don&#8217;t design for this, it will tend to happen. Better to design for it.</p>
<p><em>Allow extensibility in many directions. </em>Frameworks often allow you to make more specific versions of their components, but it&#8217;s rare that you can generalize or inject behaviour at a middle level of a concept hierarchy.</p>
<p><em>Use semantic metadata.</em> Ontologies are under heavy research in computer science. They are formal classifications of concepts and their relations. One popular format for developing ontologies is RDF(S); for an example of what the concepts can look like, check <a href="http://www.schemaweb.info/">this RDF(s) directory</a>. I will have reason to come back to this topic in the future.</p>
<p>One example of a brilliant long-lasting standard: TCP/IP. Somehow in this case, the designers got something miraculously right at the first try. I&#8217;m amazed at how we keep building on this standard every day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/the-problem-with-standards/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Research idea: a snapshot</title>
		<link>http://www.monomorphic.org/wordpress/research-plan-a-snapshot/</link>
		<comments>http://www.monomorphic.org/wordpress/research-plan-a-snapshot/#comments</comments>
		<pubDate>Tue, 19 May 2009 03:08:31 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=24</guid>
		<description><![CDATA[As part of an application form I had to fill out recently, I had to write a summary of my research ideas. Of course this changes all the time, since I&#8217;m still searching for a precise topic (and probably will be for a long time). But this is what a snapshot of those thoughts, taken [...]]]></description>
			<content:encoded><![CDATA[<p>As part of an application form I had to fill out recently, I had to write a summary of my research ideas. Of course this changes all the time, since I&#8217;m still searching for a precise topic (and probably will be for a long time). But this is what a snapshot of those thoughts, taken now, looks like:</p>
<blockquote><p>One of the most important problems in software engineering is reducing the impact of change. To this end, recently methods such as inversion of control (dependency injection) have become popular, in order to reduce the coupling to concrete interfaces. However, even with these schemes, there is still a dependency on specific names and abstract interfaces.Â  My project aims to investigate the possible use of semantic methods to address this problem. In essence, I want to allow developers to use semantic interfaces rather than syntactic ones to describe and access their components.Â </p>
<p>Specifically, I am investigating techniques commonly used in the context of Semantic Web Services, such as ontologies and semantic/syntactic mediation, and their applicability to this problem.Â </p>
<p>We may regard services as being somewhat large scale components. However, I am interested in applying these methods not just for large scale services distributed across the web, but also for small and numerous software components running in a single process. In such a setting, performance and scalability are important issues to investigate, in addition to the usual problems of reliability, correctness of composition, etc.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/research-plan-a-snapshot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code reuse according to Knuth</title>
		<link>http://www.monomorphic.org/wordpress/code-reuse-according-to-knuth/</link>
		<comments>http://www.monomorphic.org/wordpress/code-reuse-according-to-knuth/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 22:38:27 +0000</pubDate>
		<dc:creator>johan</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.monomorphic.org/wordpress/?p=7</guid>
		<description><![CDATA[I stumbled upon thisÂ interview with Donald Knuth today. In addition to the celebrated The Art of Computer Programming, Donald Knuth pioneered the concept of literate programming, which emphasises writing code for human beings to understand, as opposed to writing it for machines to understand. When being asked about current trends and fashionable practices that have [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon <a href="http://www.informit.com/articles/article.aspx?p=1193856">this</a>Â interview with Donald Knuth today. In addition to the celebrated <em>The Art of Computer Programming</em>, Donald Knuth pioneered the concept of literate programming, which emphasises writing code for human beings to understand, as opposed to writing it for machines to understand.</p>
<p>When being asked about current trends and fashionable practices that have undeserved popularity, Knuth says:</p>
<blockquote><p>I must also confess to a strong bias against the fashion for reusable code.</p></blockquote>
<p>His take, then, is that with highly readable, modifiable and accessible source code, reuse is unnecessary and dangerous. He would prefer rewriting the code for a new context.</p>
<p>I am one of those who would preach the &#8220;fashion&#8221; of reusable code. It does appear to me that reusability is very important, and in particular, I think there are tremendous benefits to be realised when the language implementation is able to reason about code. The success of languages like Java shows that the more managed and controlled the language is, the more human creativity and mental capacity is free to focus on the higher levels of abstraction. If programmers must adapt code to each context manually, surely they will be distracted from the bigger task. So my take on the issue is very different to Knuth&#8217;s.</p>
<p>But I confess to not knowing much about literate programming and to not having explored the tools (in particular Knuth&#8217;s CWEB). Perhaps I should learn more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monomorphic.org/wordpress/code-reuse-according-to-knuth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
