<?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>mattdorn.com &#187; programming</title>
	<atom:link href="http://www.mattdorn.com/content/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattdorn.com</link>
	<description>Generously funded by Matt Dorn</description>
	<lastBuildDate>Sun, 07 Feb 2010 00:07:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A few reflections on &#8220;Dreaming in Code&#8221;</title>
		<link>http://www.mattdorn.com/content/dreaming-in-code/</link>
		<comments>http://www.mattdorn.com/content/dreaming-in-code/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 21:27:34 +0000</pubDate>
		<dc:creator>mdorn</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.mattdorn.com/?p=76</guid>
		<description><![CDATA[


Some years ago I became aware of a software project called Chandler, a personal information manager/calendar/email client being developed by something called the Open Source Applications Foundation, which was started by by Mitch Kapor of Lotus fame.  It appeared on my radar for two reasons.  First, it seemed an unusually ambitious effort to [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">
<!-- -*- mode: rst -*- -->
<p>Some years ago I became aware of a software project called <a class="reference" href="http://chandlerproject.org/">Chandler</a>, a personal information manager/calendar/email client being developed by something called the <a class="reference" href="http://www.osafoundation.org/">Open Source Applications Foundation</a>, which was started by by Mitch Kapor of Lotus fame.  It appeared on my radar for two reasons.  First, it seemed an unusually ambitious effort to compete in a space that had been dominated by proprietary offerings like Microsoft Outlook; second, it was being written in what had quickly become my programming language of choice, Python.  When I learned that the project had attracted the full-time participation of industry heavyweights like Andy Hertzfeld, who played a key role in the development of the first Apple Macintosh, I was doubly interested.</p>
<p>It wasn&#8217;t long before Chandler lost my attention, though, as the hype surrounding it diminished amid complaints about its exceptionally slow progress.  Occasionally I wondered, though: How could a project with so much industry muscle behind it, being written in a language renowned for its productivity, go so far off track?  So when I read that a book-length treatment of the Chandler development process had been published, I couldn&#8217;t wait to get my hands on it.</p>
<p>Written by a fairly technically savvy layman, former <a class="reference" href="http://www.salon.com/">Salon</a> editor Scott Rosenberg, <a class="reference" href="http://www.dreamingincode.com/">Dreaming in Code</a> is an adept survey of the range of dysfunction  that plagues even the most talented software development teams.  His review of the available literature &#8212; ranging from Frederick Brooks&#8217;s <em>The Mythical Man-Month</em> (a book whose thesis furnished one of the few iron laws in the field) to Joel Spolsky&#8217;s rants on his popular &quot;Joel on Software&quot; blog &#8212; is comprehensive and informative, but probably the most insightful aspect of the book is its treatment of the aspects of software development that make it unique among disciplines.</p>
<p>For example, at the outset Rosenberg speaks of something he calls &quot;software time&quot;:</p>
<blockquote>
Time really does seem to behave differently around the act of making software.  When things go well, you can lose track of the passing hours in the state psychologists call &quot;flow.&quot; When things go badly, you get stuck, frozen between dimensions, unable to move or see a way forward.</blockquote>
<p>It is perhaps this quality, Roseberg suggests, that furnishes the foundation for Brooks&#8217;s Law, alluded to above, that &quot;adding manpower to a late software project makes it later&quot; &#8212; a seemingly paradoxical concept in most fields of endeavor.</p>
<p>Brooks provides further material for Rosenberg when he writes that &quot;the programmer, like the poet, works only slightly removed from pure thought-stuff.  He builds his castles in the air, from air, creating by exertion of the imagination.&quot;  The idealism implied by this description may be what&#8217;s behind a whole host of programming ills that lead software practitioners down a path of impracticality and ultimately cause projects to go far over budget, over schedule, or fail completely.</p>
<p>Among them is the &quot;Not Invented Here Syndrome.&quot;  The reusability of existing software components has long been one of several holy grails in the industry, and exponential increases in computing power as well as the rise of Open Source and the Internet have in many ways made it a reality.  The problem is that most programmers exhibit a tendency to want to reinvent the wheel.  On this matter Rosenberg quotes Larry Constantine at length:</p>
<blockquote>
Unfortunately, most programmers like to program. Some of them would rather program than eat or bathe.  Most of them would much rather cut code than chase documentation or search catalogs or try to figure out some other stupid programmer&#8217;s idiotic work. &#8230; Other things being equal, programmers design and build from scratch rather than recycle.</blockquote>
<p>Further complicating matters is that even the most talented programmers can undermine their own productivity by engaging in excessive &quot;axe-sharpening,&quot; or refining their development environments and tool sets, rather than focussing on solving the problem at hand.  Rosenberg offers a parable by Peter Drucker worth reproducing here:</p>
<blockquote>
<dl class="docutils">
<dt>A favorite story at management meetings is that of the three stonecutters who were asked what they were doing.  The first replied, &quot;I am making a living.&quot;  The second kept on hammering while he said, &quot;I am doing the best job of stonecutting in the entire country.&quot;  The third one looked up with a visionary gleam in his eyes and said, &quot;I am building a cathedral.&quot;</dt>
<dd>The third man is, of course, the true &quot;manager.&quot;  The first man knows what he wants to get out of the work and manages to do so.  He is likely to give a &quot;fair day&#8217;s work for a fair day&#8217;s pay.&quot;
It is the second man who is a problem.  Workmanship is essential, &#8230; but there is always a danger that the true workman, the true professional, will believe that he is accomplishing something when in effect he is just polishing stones or collecting footnotes.</dd>
</dl>
</blockquote>
<p>Programmers by their nature (or perhaps by the nature of the technology of their tools) tend to be the second man.</p>
<p>Finally, Rosenberg notes, in spite of an abundance of empirical evidence about the difficulty of successfully completing a software project (the book&#8217;s epigraph is Donald Knuth&#8217;s observation that &quot;software is hard&quot;), &quot;most of the programmers I have interviewed and gotten to know in the course of my research are consistently, and sometimes unaccountably, optimistic about their work.  If they are Sisyphuses, they are happy ones.&quot;</p>
<p>So are there any constructive lessons to be carried away from Rosenberg&#8217;s  cautionary tale?</p>
<p>Aside from implying that one ought to bring a greater awareness of the problems described above to software projects (e.g., counterbalancing programmers&#8217; unaccountable optimism when planning a project), the book does provide some insights gleaned from a few instances of successful software projects.</p>
<p>For example, Watts Humphrey, who took over IBM&#8217;s software organization in 1966, instituted a culture of planning where not only were plans mandatory, but &quot;had to be &#8216;bottom-up,&#8217; derived from the experience and knowledge of the programmers who would commit to meeting them, rather than &#8216;top-down,&#8217; imposed by executive fiat or marketing wish.&quot;  The result was an organization that &quot;did not miss a date for the next two and a half years.&quot;</p>
<p>In addition, after observing that a key problem in most software projects is the absence of a firm understanding of what it means to be &quot;done,&quot; Rosenberg reports that in the rare cases he&#8217;s seen where software projects are successful from both a budget and schedule perspective, the success is &quot;a by-product of iron-willed restraint &#8212; a choice firmly made and vocierfously reasserted at every challenge to limit a project&#8217;s scope.  Where you find software success stories, you invariably find people who are good at saying no.&quot;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mattdorn.com/content/dreaming-in-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>reStructuredText tools for gedit</title>
		<link>http://www.mattdorn.com/content/restructuredtext-tools-for-gedit/</link>
		<comments>http://www.mattdorn.com/content/restructuredtext-tools-for-gedit/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 09:20:07 +0000</pubDate>
		<dc:creator>mdorn</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[reStructuredText]]></category>

		<guid isPermaLink="false">http://67.207.132.145/wordpress/?p=41</guid>
		<description><![CDATA[


Over the last couple of days, I put together some reStructuredText tools for gedit, the lightweight text editor for the Gnome desktop on Linux.  They include syntax highlighting, some keyboard shortcuts, and an HTML preview feature that I derived from another developer&#8217;s earlier work on Markdown support.
This was made possible by gedit&#8217;s excellent plugin [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">
<!-- -*- mode: rst -*- -->
<p>Over the last couple of days, I put together some <a class="reference" href="http://textmethod.com/wiki/ReStructuredTextToolsForGedit">reStructuredText tools for gedit</a>, the lightweight text editor for the Gnome desktop on Linux.  They include syntax highlighting, some keyboard shortcuts, and an HTML preview feature that I derived from another developer&#8217;s earlier work on <a class="reference" href="http://live.gnome.org/Gedit/MarkdownSupport">Markdown support</a>.</p>
<p>This was made possible by gedit&#8217;s excellent plugin system, which allows you extend the application via <a class="reference" href="http://python.org">Python</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mattdorn.com/content/restructuredtext-tools-for-gedit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting started with Darcs</title>
		<link>http://www.mattdorn.com/content/getting-started-with-darcs/</link>
		<comments>http://www.mattdorn.com/content/getting-started-with-darcs/#comments</comments>
		<pubDate>Wed, 19 Apr 2006 13:53:54 +0000</pubDate>
		<dc:creator>mdorn</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://67.207.132.145/wordpress/?p=32</guid>
		<description><![CDATA[


The following is a rudimentary set of instructions for setting up, on a Linux server, a Darcs repository which uses the most basic possible method for collaboration, in which a single administrator manually applies patches1 sent him/her via email (automatically, via the darcs send command issued by the contributor).2  Some notes on producing those [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">
<!-- -*- mode: rst -*- -->
<p>The following is a rudimentary set of instructions for setting up, on a Linux server, a Darcs repository which uses the most basic possible method for collaboration, in which a single administrator manually applies patches<a class="footnote-reference" href="#id3" id="id1" name="id1"><sup>1</sup></a> sent him/her via email (automatically, via the <tt class="docutils literal"><span class="pre">darcs</span> <span class="pre">send</span></tt> command issued by the contributor).<a class="footnote-reference" href="#id4" id="id2" name="id2"><sup>2</sup></a>  Some notes on producing those patches and managing the repository are also included.  Further information, including info on how to retract changes, is available in the <a class="reference" href="http://darcs.net/manual/">Darcs manual</a>.</p>
<div class="section">
<h2><a id="preparing-the-central-darcs-respository" name="preparing-the-central-darcs-respository">Preparing the central Darcs respository</a></h2>
<p>Upload your public files to where your public repo will be, and then create a repository there, recursively adding the project&#8217;s files to it:</p>
<pre class="literal-block">
cd proj_folder
darcs init
darcs add -r *
</pre>
<p>Then record a comment for the patch:</p>
<pre class="literal-block">
darcs record -a
</pre>
<p>The <tt class="docutils literal"><span class="pre">-a</span></tt> flag will apply all the patches without prompting the user to approve each one.  In the case of creating a new project, that means &quot;addfile&quot; patches (which are not really patches in the traditional sense) will be submitted for each file, along with the &quot;hunks&quot; containing the new code represented by the new files.</p>
<p>You can avoid any prompt at all by issuing the command with an extra flag and the patch name:</p>
<pre class="literal-block">
darcs record -am &quot;Project imported.&quot;
</pre>
<p>The first time you do this, you&#8217;ll be prompted to add an email address for the &quot;patch&#8217;s author&quot;, which in turn will create the <tt class="docutils literal"><span class="pre">_darcs/prefs/author</span></tt> file in your project directory.</p>
<p>Because this will be a basic repository where sent patches will be applied by the administrator, you&#8217;ll also want to manually add a file called <tt class="docutils literal"><span class="pre">email</span></tt> to that same directory (<tt class="docutils literal"><span class="pre">_darcs/prefs</span></tt>).  That file should contain a single line: the email address of the administrator who will apply the patches.  Subsequently issuing of the <tt class="docutils literal"><span class="pre">darcs</span> <span class="pre">send</span></tt> command by project contributors will use that email address as the destination for the patch.</p>
<p>You must now make the repository available to remote users.  The easiest way to do that is via the Apache Web server.  Make a directory in your Apache root called <tt class="docutils literal"><span class="pre">repos</span></tt> and in that directory, and simply symlink to the directory of your Darcs-enabled project.  You may have to check to make sure that the appropriate Apache directive allows for following of symlinks.  In my case, I also had to make the project directory (and its parent directory, in fact) world-executable.</p>
<p>The main repository is now available for retrieval by collaborators.  As the Darcs documentation states, &quot;As long as you’re running a web server and making your repo available to the world, you may as well make it easy for people to see what changes you’ve made.&quot;  There&#8217;s a CGI script that allows users to browse the patch history of your projects.  In Ubuntu Linux (Breezy), the <tt class="docutils literal"><span class="pre">darcs-server</span></tt> package handles its installation for you, installing the file <tt class="docutils literal"><span class="pre">/usr/lib/cgi-bin/darcs.cgi</span></tt>.  That works out-of-the-box with Ubuntu&#8217;s Apache install.  If you&#8217;ve installed darcs manually, you may have to run <tt class="docutils literal"><span class="pre">make</span> <span class="pre">installserver</span></tt> to do the same.  Note that you can change the name and location of your <tt class="docutils literal"><span class="pre">repos</span></tt> directory, mentioned above, in <tt class="docutils literal"><span class="pre">/etc/darcs/cgi.conf</span></tt>.</p>
</div>
<div class="section">
<h2><a id="applying-patches" name="applying-patches">Applying patches</a></h2>
<p>As patches start coming in via email from contributors, you&#8217;ll need to apply them to the central repo.</p>
<p>The most direct way to do that would to be to login via a shell to the central repository&#8217;s server, and:</p>
<pre class="literal-block">
cd /path/to/project
darcs apply /path/to/patch
</pre>
<p>Another possible option is for the project administrator to maintain a local repo in addition to the central repo, apply any patches there (also using <tt class="docutils literal"><span class="pre">darcs</span> <span class="pre">apply</span></tt>), and then use his or her shell account to &quot;push&quot; the local repo changes to the central repo server:</p>
<pre class="literal-block">
darcs push username&#64;website.com:/path/to/repos/proj_name
</pre>
</div>
<div class="section">
<h2><a id="contributing-to-the-repo" name="contributing-to-the-repo">Contributing to the repo</a></h2>
<p>If you&#8217;re a contributor who wants to work with the project for the first time you retrieve it from the Web like so:</p>
<pre class="literal-block">
darcs get http://www.website.com/repos/proj_name
</pre>
<p>Now you have a copy of the repo, a fully functional branch.</p>
<p>After working with the project, making changes, etc., you can view the changes you&#8217;ve made since your last repo update:</p>
<pre class="literal-block">
darcs whatsnew
</pre>
<p>(Add the <tt class="docutils literal"><span class="pre">--summary</span></tt> flag for less verbose output, also add the &#8211;look-for-adds flag to see any new files that have been created since your last check-in.  You&#8217;ll need to add them manually (see below).)</p>
<p>Name your patch and comment on the details of your changes:</p>
<pre class="literal-block">
darcs record -a
</pre>
<p>And send them to the central repo (in our case, via email):</p>
<pre class="literal-block">
darcs send -a
</pre>
<p>(Note the <tt class="docutils literal"><span class="pre">-a</span></tt> flag in the above two commands, indicating all patches; otherwise you&#8217;ll have to approve them one-by-one.)</p>
<p>Note that &quot;darcs send&quot; will fail if you do not have a local mail agent installed.  In that case, the best way is simply to output the patch as a file, like so:</p>
<pre class="literal-block">
darcs send -a --output=/tmp/changes.patch
</pre>
<p>Note also that if you added any files, you&#8217;ll need to explicitly add them to the repo:</p>
<pre class="literal-block">
darcs add myscript.py
</pre>
<p>If you want to subsequently pull other contributors&#8217; changes from the repo:</p>
<pre class="literal-block">
darcs pull http://www.website.com/repos/proj_name
</pre>
<p>Add the <tt class="docutils literal"><span class="pre">-a</span></tt> flag to avoid being asked to confirm on a per-patch basis.</p>
</div>
<div class="section">
<h2><a id="tagging-versions-and-getting-tagged-versions" name="tagging-versions-and-getting-tagged-versions">Tagging versions and getting tagged versions</a></h2>
<p>From the <a class="reference" href="http://darcs.net/manual/">Darcs manual</a>:</p>
<blockquote>
While pull and unpull can be used to construct different &quot;versions&quot; in a repository, it is often desirable to name speciﬁc conﬁgurations of patches so they can be identiﬁed and retrieved easily later. This is how darcs implements what is usually known as versions. The command for this is tag, and it records a tag in the current repository.</blockquote>
<p>So, to tag a version 1.0, for example, in the project directory execute:</p>
<pre class="literal-block">
darcs tag 1.0
</pre>
<p>And to get the tree for that version later:</p>
<pre class="literal-block">
darcs get --tag &quot;1.0&quot; http://www.website.com/repos/proj_name
</pre>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1" name="id3">[1]</a></td><td>According to Darcs&#8217; &quot;theory of patches,&quot; pretty much any change to the tree&#8211;including the adding and removing of files&#8211;is a &quot;patch.&quot;</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id4" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2" name="id4">[2]</a></td><td>The <a class="reference" href="http://darcs.net/manual/">Darcs manual</a> describes other methods like the <tt class="docutils literal"><span class="pre">darcs</span> <span class="pre">push</span></tt> command, which requires SSH accounts on the server running Darcs for the users collborating on your project, and also includes instructions for an interesting setup involving automatic application of patches arriving via PGP-signed email messages from authorized addresses.</td></tr>
</tbody>
</table>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mattdorn.com/content/getting-started-with-darcs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
