<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Edd Dumbill's Weblog: 'programming' articles</title>
  <link href="http://times.usefulinc.com/tagprogrammingatom" rel="self"/>
  <link href="http://times.usefulinc.com/tagprogramming" rel="alternate"/>
  <id>http://times.usefulinc.com/</id>
  <updated>2008-06-23T11:37:18Z</updated>
  <author>
    <name>Edd Dumbill</name>
    <email>edd-web@usefulinc.com</email>
  </author>
  <entry>
    <title>Social area networking please</title>
    <link href="http://times.usefulinc.com/2008/06/23-san" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/922</id>
    <updated>2008-06-23T11:37:18Z</updated>
    <published>2008-06-23T11:30:04Z</published>
    <summary> I want to use existing Bonjour-aware tools among an ad-hoc group of people</summary>
    <category term="programming"/>
    <category term="agile"/>
    <category term="lazyweb"/>
    <content type="html">
&lt;p&gt;Tom Morris mentioned the &lt;a href="http://drnicwilliams.com/2008/06/18/what-is-gitjour-gemjour-starjour/"&gt;gitjour&lt;/a&gt; project on the semantic web IRC channel today and it set me thinking.&lt;/p&gt;
&lt;p&gt;Gitjour enables collaboration on a local network by tying together Bonjour (aka Zeroconf) and the git distributed source control system. It lets a developer publish the source direct from their own machine, without having to set up a public mirror. The advantages are great for camp-style hackathons.&lt;/p&gt;
&lt;p&gt;However, I rarely get to such hurrahs and if I do, prefer to spend time talking to others and mining their brains. What I do have though is an extended, continuous "camp" that exists among a subset of my IM contacts, Twitter friends, and so on.&lt;/p&gt;
&lt;p&gt;What I want is a version of Bonjour that works over a virtual network established from an ad-hoc list of friends and groups selectable from a social networking tool.&lt;/p&gt;
&lt;p&gt;I know, this is starting to sound like Groove or any other number of peer-based collaborative tools. The point is I don't want to join any walled garden and get "monetized", I want to use existing Bonjour-aware tools, just among an ad-hoc group of people.&lt;/p&gt;
&lt;p&gt;The hard bit as ever is firewall traversal, but this has been solved more than a few times now. It seems we've got the tools, we just need some enterprising developer to glue it all together.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://times.usefulinc.com/2008/06/23-san#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>We're all ops people now</title>
    <link href="http://times.usefulinc.com/2008/06/16-ops-now" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/918</id>
    <updated>2008-06-16T12:34:09Z</updated>
    <published>2008-06-16T10:55:22Z</published>
    <summary>Five years ago, would you have been managing terabits and arrays of distributed services?</summary>
    <category term="programming"/>
    <category term="linux"/>
    <category term="agile"/>
    <category term="sysadmin"/>
    <category term="xen"/>
    <category term="hosting"/>
    <category term="infrastructure"/>
    <content type="html">
&lt;p&gt;Ten years ago, most of us wouldn't have dreamt we'd be managing terabits of storage, tens of megabits of bandwidth, arrays of network-distributed services. The height of a programmer's worry would likely be choice of UI toolkit or finding the right way to indent code, and the height of consumer concern deciding which room to put the new computer in.&lt;/p&gt;
&lt;p&gt;Now the problems associated with managing large networks are becoming real for everyone, right down to the consumer level. Stupendously large amounts of computing resource are available at an instant.&lt;/p&gt;
&lt;p&gt;Your household probably has more than a terabyte of storage already. Issues such as single sign-on are going to hit home over the next year, as networked computing and entertainment devices profilerate. Features such as Apple's &lt;a href="http://www.apple.com/macosx/features/timemachine.html"&gt;Time Machine&lt;/a&gt; will be increasingly vital &amp;mdash; software that makes traditionally gnarly sysadmin tasks consumer-friendly. The rebranding of .Mac into "&lt;a href="http://www.apple.com/mobileme/"&gt;Mobile Me&lt;/a&gt;" is also a step in this direction.&lt;/p&gt;
&lt;h3&gt;The impact on developers&lt;/h3&gt;
&lt;p&gt;As software developers, we also have to cope with the effects of this resource-richness. For small sums of money we can get access to &lt;a href="http://aws.amazon.com/ec2"&gt;large computing clusters&lt;/a&gt;, geographically redundant hosting services. Our programs have left the desktop and found their new home on the web. System administration issues loom large upon us, security concerns lurk auspiciously in the corners of our minds.&lt;/p&gt;
&lt;p&gt;Although the cost of infrastructure has dropped radically, other costs remain high and are going to stay that way. System administrators are not only grumpy, they demand high wages. Commercial software license fees spiral out of control: traditional per-CPU licensing models make little sense when you can quickly bring up tens of machines. The cost in power is already troubling large companies, and there's no reason to suspect the problems won't ripple down.&lt;/p&gt;
&lt;p&gt;Help is at hand from a variety of technologies. If they don't yet make massive resource management trivial, they at least make it possible. Some of these also inhabit the weird territory of being both the source of a problem and a solution at the same time: virtualization, for example.&lt;/p&gt;
&lt;h4&gt;Distributed revision control systems&lt;/h4&gt;
&lt;p&gt;Distributed revision control is a technology whose time has finally&amp;nbsp;come in popular circles, thanks in part to Linus Torvald's &lt;a href="http://git.or.cz/"&gt;Git&lt;/a&gt; system. DRCS has several important impacts on today's developer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-style: italic;"&gt;Branching and, importantly, merging become much cheaper&lt;/span&gt;, allowing agile and flexible iterations of development.&lt;/li&gt;
&lt;li&gt;&lt;span style="font-style: italic;"&gt;Loosely connected and geographically diverse development becomes much easier&lt;/span&gt;. Even within a single organization it is not uncommon to find teams spanning countries, time zones. Complex multi-site VPN setups aren't necessary when a few SSH keys can do the job.&lt;/li&gt;
&lt;li&gt;&lt;span style="font-style: italic;"&gt;Revision control becomes packaging on the cheap&lt;/span&gt;. Like it or not, the mere tagging of a source tree has now become a valid option for releasing software.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All these trends lower the barrier to entry, increase collaboration and agility of development. You can the value of this as more software tools become free. Selling such tools is rapidly becoming a thing of the past, the advantages of sharing enable the developers at the sharp end to get their jobs done quicker.&lt;/p&gt;
&lt;p&gt;However, such increased agility and, well, messiness leave other problems to solve, which the next two technologies address.&lt;/p&gt;
&lt;h4&gt;Virtualization&lt;/h4&gt;
&lt;p&gt;Hardware-as-a-service, infrastructure-as-a-service, &lt;a href="http://www.roughtype.com/archives/2008/01/a_little_too_mu.php"&gt;call it what you will&lt;/a&gt;. The ability to create what we used to call entire machines, pick them up and move them around the network is revolutionary, and it's something that will have a real impact on regular developers. The benefits are at several levels.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-style: italic;"&gt;Agile infrastructure&lt;/span&gt; &amp;mdash; a ready supply of new machines makes it a lot easier and cheaper to test different scenarios, architectures, and to separate concerns. If things go wrong, throw away the image and start over. It's all about cutting the administration load.&lt;/li&gt;
&lt;li&gt;&lt;span style="font-style: italic;"&gt;A packaging solution&lt;/span&gt; &amp;mdash; the new macroeconomics of software distribution mean that distributing entire machine images which communicate exclusively via the network is now a feasible way to distribute your software. We must adjust to the notion of distributing appliances, not code. We may mourn the lost crafts of creating RPMs or installers, but let's face it, it's now a waste of time.&lt;/li&gt;
&lt;li&gt;&lt;span style="font-style: italic;"&gt;New business models&lt;/span&gt; &amp;mdash; your application can now be delivered as a black-box appliance, circumventing compatibility issues, or as a service, with virtualization part of the solution to scaling.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Configuration management&lt;/h4&gt;
&lt;p&gt;Computing is a zero-sum game, and despite our increased ability to create and distribute software, problems still exist. We just pushed them to the next level.&lt;/p&gt;
&lt;p&gt;In good part, this next level is the problem of configuration management. We now have networks and clusters of (virtual) machines, software so agile we need six decimal places to describe its revision levels, and network and authentication paths that are starting to tangle. How do we manage that?&lt;/p&gt;
&lt;p&gt;One thing developers crave is repeatability. That's why we love our makefiles, autoconf, Ant, rake and so on. It's the one time even the most imperative-minded programmer writes declarative code. We like to say "let the world be like this."&lt;/p&gt;
&lt;p&gt;Our new sprawling world lacks this feature, and the best of our old toolkits &amp;mdash; .debs, RPMs &amp;mdash; address things only at the level of packages in a single environment.&lt;/p&gt;
&lt;p&gt;So developers must look to the world of operations, a territory we probably thought we needn't enter. In this world the new "make" is called&amp;nbsp;&lt;a href="http://reductivelabs.com/trac/puppet"&gt;Puppet&lt;/a&gt;. You write recipes to describe how things ought to be, and Puppet will make it so.&lt;/p&gt;
&lt;p&gt;I've been spending some time digging into Puppet, and feel excited by the confidence it's giving me. Now my applications exceed single source trees, and single machines, it gives me the means to tie the whole together. This article was going to be solely about Puppet, but that will have to wait now for another time.&lt;/p&gt;
&lt;p&gt;It's likely you'll have played with virtual machines and distributed revision control, but have you tried Puppet yet? Give it a spin, and let your mind wander over the benefits for your organization and development approaches.&lt;/p&gt;
&lt;h3&gt;Conclusions&lt;br /&gt;&lt;/h3&gt;
&lt;p&gt;For developers and users alike, our world is changing. Hardware, connectivity and increasingly software is becoming cheap or free. The solidity of the old things we put value on &amp;mdash; real things you can touch like disks &amp;mdash; is eroding.&lt;/p&gt;
&lt;p&gt;What really matters is our data, our creations, and their communication. If they don't quite yet exist in a universal "cloud" yet, they're certainly getting frisky.&lt;/p&gt;
&lt;p&gt;As vendors provide solutions for consumers to manage their new domestic infrastructure, developers must look to network-aware toolkits and operations techniques to manage and get the best from their emergent infrastructures.&lt;/p&gt;
&lt;p&gt;Also on this topic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://times.usefulinc.com/2006/06/17-agile-infrastructure"&gt;In search of agile infrastructure for web applications&lt;/a&gt;&amp;nbsp;(June 2006)&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;a href="http://times.usefulinc.com/2008/06/16-ops-now#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Collecting minimal user information</title>
    <link href="http://times.usefulinc.com/2007/06/22-disclosure" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/897</id>
    <updated>2007-06-22T16:42:49Z</updated>
    <published>2007-06-22T15:37:46Z</published>
    <summary>Asking for too much information from users is a barrier to participation. So, we invented a way to make sure that users only get asked for as much as we need to know.</summary>
    <category term="programming"/>
    <category term="rails"/>
    <category term="expectnation"/>
    <category term="community"/>
    <content type="html">
 &lt;p&gt;Web applications are in constant competition for a user's attention. Unlike shrink-wrap software, there's often no captive audience, and web apps must gently guide and woo users to help them to the best experience of the software.&lt;/p&gt; &lt;p&gt;This is particularly true when considering the problem of collecting personal details from a user. Collect too little information, and your app might not be able to function effectively. Collect too much information, and you raise the barrier for participation with your application. Users may either not be bothered, be alarmed at the apparent intrusion into their privacy, or fill out bogus information.&amp;nbsp;&lt;/p&gt; &lt;h3&gt;One size doesn't fit all&lt;br /&gt; &lt;/h3&gt; &lt;p&gt;I originally stumbled on the issue in the development of &lt;a href="http://expectnation.com/"&gt;Expectnation&lt;/a&gt;. The amount of information a conference speaker needs to give the organizers is significantly more than that of, say, a reviewer. An organizer will often want postal and phone details for a speaker, which are largely irrelevant to the review process. All conferences and events rely on the willingess of participants, so the path to participation needs to be as frictionless as possible.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Thus, a one-size-fits-all personal details form didn't make sense for us. At best, we could have simply made more fields optional, but that would result in missing information that we really did need.&lt;/p&gt; &lt;p&gt;Another solution would be to provide a dedicated personal details form per user type, e.g. different forms for speakers and reviewers. This is a non-starter, however, as users can take on many roles within a conference.&lt;/p&gt; &lt;p&gt;So, we had a problem on our hands: different levels of interaction with our application requires different levels of personal information.&lt;/p&gt; &lt;p&gt;We also had a second problem, which is that not all events and organizers want the same level of information. For example, a user group event is unlikely to need the same amount of information from speakers as an academic conference.&lt;/p&gt; &lt;p&gt;Thus we have two axes on which the amount of information required varies: by role, and by event.&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Our solution: progressive disclosure&lt;/h3&gt; &lt;p&gt;We concluded that we wanted to adhere to two principles in the collection of user information for Expectnation:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;collect as little information from users as possible, and&lt;br /&gt; &lt;/li&gt; &lt;li&gt;allow organizers to determine the level of information they wish to collect.&lt;/li&gt; &lt;/ul&gt; The first objective was achieved by constructing a matrix of information items against user role, with the possible values of {required, optional, unused} for each item. We then achieved the second objective by allowing this matrix to be varied over each event. &lt;p&gt;We've named this concept &amp;quot;&lt;a href="http://expectnation.com/public/content/2007/06/21-tip-user-disclosure"&gt;progressive disclosure&lt;/a&gt;.&amp;quot;&lt;/p&gt; &lt;p&gt;What this means in practice is that a user is only ever asked for the information required to fulfil the roles they have within Expectnation. If they take on another role, they are asked for the additional information at that point, and not before.&lt;/p&gt; &lt;h3&gt;Implementation concerns&lt;/h3&gt; &lt;p style="float: right; margin-left: 10px; text-align: center"&gt;&lt;img width="341" height="229" src="http://times.usefulinc.com/asset/name/39/small-disc.jpg" alt="Expectnation user disclosure editing" /&gt;&lt;br /&gt;Extract from disclosure level editing UI&lt;/p&gt; &lt;p&gt;It would be untrue to say that progressive disclosure is simple to implement.&lt;/p&gt; &lt;p&gt;A user in our system will have disclosure requirements that are the union of all of their roles in all of the events they attend. Within Ruby on Rails, this means the conventional validation logic is useless to us, as it only deals with static requirements. Secondly, disclosure requirements are expensive to compute, so we need to cache them, with the inevitable addition of issues such as cache invalidation.&lt;/p&gt; &lt;p&gt;Beyond the data model issues, the user interface issues are, if anything, more troublesome. From an end-user's point of view, the difficulty arises when we need extra information from them, and presenting this in a way that makes sense.&lt;/p&gt; &lt;p&gt;From the event organizer's point of view, we have the challenge of presenting a controlling user interface for rather a complex concept. Organizers must be able to change the level of required information either globally, or per-event.&lt;/p&gt; &lt;p&gt;We opted for a grid presentation, an extract from which is shown in the screenshot in this article. Over time we'll be able to see how effective this interface is, and what we can do to improve it.&lt;/p&gt; &lt;p&gt;Finally, we have chosen sensible defaults for all disclosure levels, as the best result would be that organizers have little need to reconfigure the settings in the first place.&lt;/p&gt; &lt;h3&gt;Making it look easy&lt;/h3&gt; &lt;p&gt;Because Expectnation is a general application for organizing events, rather than targetting one specific one, we've had to construct a framework for minimizing user information collection, as opposed to simple implementation of known scenarios.&lt;/p&gt; &lt;p&gt;At the end of the day we have added a fairly complicated subsystem and an extra degree of complexity to our codebase. However, the result from the user's point of view is increased simplicity and a streamlined experience.&lt;/p&gt; &lt;p&gt;Every time you embark on something that wide-reaching and complex, you have to ask yourself whether the feature is really worth it. In this case, though, the answer is a resounding &amp;quot;yes&amp;quot;. The user is the most important factor in our software, and making their life easier in an unobtrusive manner is a priority.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Expectnation blog: &lt;a href="http://expectnation.com/public/content/2007/06/21-tip-user-disclosure"&gt;Only ask users for the information you need&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;p&gt;&lt;a href="http://times.usefulinc.com/2007/06/22-disclosure#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Why Bazaar rocks, and the highs and lows of its use with Rails</title>
    <link href="http://times.usefulinc.com/2007/06/20-bzr" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/895</id>
    <updated>2007-06-20T11:38:45Z</updated>
    <published>2007-06-20T11:04:52Z</published>
    <summary>Mark Shuttleworth writes about the importance of merging in version control systems.</summary>
    <category term="programming"/>
    <category term="rails"/>
    <category term="agile"/>
    <category term="bzr"/>
    <content type="html">
&lt;p&gt;While &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt; is for many the source code revision system of choice, I've never stopped long with it myself. Why? Because it's mostly a fixed-up &lt;a href="http://www.nongnu.org/cvs/"&gt;CVS&lt;/a&gt;, and doesn't fix the really gnarly problem with revision control: merging.&lt;/p&gt;&lt;p&gt;Mark Shuttleworth has written an &lt;a href="http://www.markshuttleworth.com/archives/126"&gt;insightful little article&lt;/a&gt; on the key aspects of merging source code. Some of the points he makes underpin my choice of revision control system.&lt;/p&gt;&lt;p&gt;For several years now I've been a very contented user of &lt;a href="http://bazaar-vcs.org/"&gt;Bazaar&lt;/a&gt;, in its &lt;a href="http://bazaar-vcs.org/Baz1x"&gt;first arch-based incarnation&lt;/a&gt;, and now in its latter form. The key reason has been ease of merging.&lt;/p&gt;&lt;p&gt;While most articles praising Bazaar are reports of open source development, I've also found it very handy for small in-house teams working on web applications.&lt;/p&gt;&lt;p&gt;There are very often multiple arcs of development going on at once, and the ease of merging makes it easy to ensure that long-running development arcs don't get ridiculously far from the main trunk of development. Bazaar's merging also makes it easier for lead developers to police the merging of the code base.&lt;/p&gt;&lt;h3&gt;Using Bazaar with Rails and other tools&lt;/h3&gt;&lt;p&gt;Working mostly with Rails, one repeatedly runs up against the assumption that Subversion is the golden path for revision control. This is perhaps a little telling about the level of participation most Rails-based projects have reached.&lt;/p&gt;&lt;p&gt;The tools story for a Bazaar user is both good and bad.&lt;/p&gt;&lt;h4&gt;The good&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Deployment&lt;/strong&gt;: the &lt;a href="http://www.capify.org/"&gt;Capistrano&lt;/a&gt; deployment system has support for Bazaar. I've written previously about &lt;a href="http://times.usefulinc.com/2006/09/29-rails-bzr"&gt;the technique I use to deploy my Rails apps&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Collaboration&lt;/strong&gt;: &lt;a href="http://trac.edgewall.org/"&gt;Trac&lt;/a&gt; is a wonderful integrated bug database, wiki and source code browser. Although it's a little hard to find, the &lt;a href="http://bazaar-vcs.org/TracBzr"&gt;trac-bzr integration&lt;/a&gt; works very well, and happily moves Trac out of the Subversion-based assumption that you can only have one repository root per project.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;The bad&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Continuous integration&lt;/strong&gt;: with &lt;a href="http://www.expectnation.com/"&gt;Expectnation&lt;/a&gt;, we've had to roll our own continuous integration system ('system' being rather a grand word for a shell script on a cronjob...) Most of the CI systems currently popular seem to assume Subversion.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Editor/IDE integration&lt;/strong&gt;: &lt;a href="http://bazaar-vcs.org/3rdPartyTools"&gt;some early work exists&lt;/a&gt;, but it's early days. I've not yet found anything making me want to leave the command line.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;a href="http://times.usefulinc.com/2007/06/20-bzr#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Really really getting the testing religion</title>
    <link href="http://times.usefulinc.com/2006/11/23-test-or-die" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/875</id>
    <updated>2006-11-23T13:03:44Z</updated>
    <published>2006-11-23T11:21:38Z</published>
    <summary>A short explanation of how I can't live without tests any longer.</summary>
    <category term="programming"/>
    <category term="rails"/>
    <category term="agile"/>
    <content type="html">
  &lt;p&gt;&lt;a href="http://www.agiledata.org/essays/tdd.html"&gt;Writing tests&lt;/a&gt; is virtuous. It's the wholemeal bread of programming. Do it, and you'll be so much fitter. Except it tastes like cardboard and gets in the way of consuming the yummy treacle sponge of programming.&lt;/p&gt;   &lt;p&gt;But now I've got the testing religion. I view the lack of tests with the disapprobation of a reformed smoker tutting and huffing at the merest suggestion of a Marlboro Light.&lt;/p&gt;   &lt;p&gt;How did this happen and how can I be sure I won't backslide?&lt;/p&gt;   &lt;p&gt;The moment of transition was the first time that a test saved me from releasing software with a bad bug in it. The theoretical knowledge of virtue was translated into the palpitating relief of not disgracing myself in public.&lt;/p&gt;   &lt;p&gt;After that happened a few more times, I found myself desperately uncomfortable with the idea of releasing anything that didn't have decent test coverage. And so a virtuous habit is formed.&lt;/p&gt;   &lt;p&gt;It's not just driven by fear. With the right tools to hand, writing tests can be a lot of fun. You don't always need to be &amp;quot;in the zone&amp;quot;. If you've got a spare half hour here and there, you can use it to increase the coverage of your tests.&lt;/p&gt;   &lt;p&gt;Getting better at testing is one of the ways I've become a much more proficient Rails developer over the last year of work on &lt;a href="http://www.expectnation.com/"&gt;Expectnation&lt;/a&gt;. In case it helps anybody else, I thought I'd share some of the tools and techniques that are part of making Rails testing fun and effective.&lt;/p&gt;  &lt;h4&gt;Continuous testing&lt;/h4&gt;  &lt;p&gt;Whenever a checkin is made to our source repository, tests are run and the results emailed to everybody working on the project. As with the &amp;quot;&lt;a href="http://www.youbrokethebuild.com/"&gt;you broke the build&lt;/a&gt;&amp;quot; disincentive, you need to be kept honest by frequent running of the tests.&lt;/p&gt;   &lt;p&gt;There are a variety of tools around to help you do continuous integration with Rails, most of which have some dependence on you using Subversion for source control. In the event, I just created my own script to do what we required.&lt;/p&gt;  &lt;h4&gt;Coverage reports&lt;/h4&gt;  &lt;p&gt;&lt;img width="313" vspace="8" hspace="8" height="110" align="right" src="http://times.usefulinc.com/asset/name/15/rcov_bars.png" alt="rcov coverage bars" title="rcov coverage bars" /&gt;One of the big mental hurdles with testing is knowing how many tests you should aim for.&amp;nbsp; You can't prove a negative: even if your tests are all passing it still doesn't tell you much about the tests you haven't written that might fail!&lt;/p&gt;   &lt;p&gt;We use &lt;a href="http://eigenclass.org/hiki.rb?rcov"&gt;rcov&lt;/a&gt; as part of the continuous integration process, and post the results to our project web site. The pretty red and green bars give you some idea of when you're starting to get adequate test coverage, and the line-by-line breakdown is invaluable.&lt;/p&gt;  &lt;h4&gt;Tainting strings&lt;/h4&gt;  &lt;p&gt;One of the easiest errors to make in Rails templates is to miss the call to &lt;em&gt;h()&lt;/em&gt;, to escape any HTML in an output string. The only real way to catch these errors is through automation. The wonderful &lt;a href="http://www.agilewebdevelopment.com/plugins/safe_erb"&gt;safe_erb&lt;/a&gt; plugin helps you do just that. By using Ruby's tainting mechanism for strings, it throws an exception if you render any external data unescaped.&lt;/p&gt;   &lt;p&gt;One of the beneficial side effects of safe_erb is that you then become very particular about ensuring your functional tests properly cover every action in your application.&amp;nbsp; Tests such as &lt;em&gt;get 'index'&lt;/em&gt;, which before seemed mundane and redundant, are now essential, as you want to test for tainted strings.&lt;/p&gt;   &lt;p&gt;In addition to the above techniques, there are a lot of fun shiny gadgets to help you write tests, such as &lt;a href="http://www.zenspider.com/ZSS/Products/ZenTest/"&gt;ZenTest&lt;/a&gt;, but the three things above are the ones I've found to be of significant value.&lt;/p&gt;   &lt;p&gt;I ought to conclude with words of praise for Rails. It goes out of its way to make testing an important part of the development lifecycle, and the availability of the of unit, functional and integration test functionality makes it easy to get started. Every time I teach somebody about Rails' testing features, they end up finding it very enjoyable.&lt;br /&gt;  &lt;/p&gt;   &lt;p&gt;Don't forget, testing can be fun!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://times.usefulinc.com/2006/11/23-test-or-die#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>In search of agile infrastructure for web applications</title>
    <link href="http://times.usefulinc.com/2006/06/17-agile-infrastructure" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/855</id>
    <updated>2006-06-17T22:57:35Z</updated>
    <published>2006-06-17T21:11:33Z</published>
    <summary>Many advances have been made in agile programming frameworks, enabling a reduction in the amount of code that needs to be written. But what about agile system infrastructure for web applications?</summary>
    <category term="programming"/>
    <category term="linux"/>
    <category term="agile"/>
    <category term="sysadmin"/>
    <content type="html">
&lt;p&gt;Many advances have been made in &lt;a href="http://agilemanifesto.org/"&gt;agile software development&lt;/a&gt;. Frameworks such as Ruby on Rails embody agile principles by making software easy to write, easy to test, and above all, easy to change.&lt;/p&gt;&lt;p&gt;If only we could say the same for the infrastructure on which we develop and deploy web applications. Not every application can be a Rails one, especially where it's been up and running for years. The systems we deploy on often rely on configuration files scattered all over the filesystem, and can be complex results of years of change.&lt;/p&gt;&lt;p&gt;By extension, the systems we develop on often don't exactly mirror where we deploy. If we're lucky and careful, then we have a staging server which mirrors the live environment, but that's not too much of an advantage. Among other things, we need ways to evolve and refactor the live environment, and have our development environments easily track that.&lt;/p&gt;&lt;p&gt;I'd like to call such an environment &amp;quot;agile infrastructure&amp;quot;. Infrastructure that doesn't hamper developers, and allows live configurations to change and evolve. Infrastructure that allows new things to be tried with minimum cost, and can provide the best information possible to help future planning.&lt;/p&gt;&lt;p&gt;Tools enable techniques, of course. It's a lot easier to be agile if you're programming in Rails rather than plain old PHP. So what are the tools enabling agile infrastructure?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Techniques I've found useful&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;While there's a long way to go, I'd like to describe some of the techniques I've been using to help create a flexible environment for developing a sizeable PHP/MySQL application.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Operating system&lt;/em&gt;&lt;/p&gt;&lt;p&gt;An operating system must be easy to bring into a known state with minimum interference. For this, I've found Ubuntu or Debian to be an ideal choice. Two of the main reasons include the constancy of stable releases and the fact that it's rare you need to stray outside the distribution's servers to get the software you need.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Deployment&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Deploying an application shouldn't break the cleanliness of your OS build. I prefer to package deployed applications into &lt;em&gt;.deb&lt;/em&gt; files. This enables me to build on several advantages of the package management system:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;configuration file handling: deployed machines can keep individual config in /etc, which is preserved over software update.&lt;/li&gt;&lt;li&gt;no random state: you know for sure exactly the state of the deployed application, no random files left hanging around.&lt;/li&gt;&lt;li&gt;natural workflow: packages take a little bit of effort to build and deploy, which means it focuses developers on getting them right. If things do go wrong, it's very easy to roll back one version.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;Source control&lt;/em&gt;&lt;/p&gt;&lt;p&gt;The case for source control, thankfully, doesn't need making these days. Yet not every source control system is created equal. Developers shouldn't be constrained by source control, it should be cheap and easy to try new ideas and merge these in later.&lt;/p&gt;&lt;p&gt;Not only cheap branching, but also easy merging, is required to keep development agile while still retaining the benefits of source control. Many people flock to Subversion these days, predominantly because it fixes some of CVS' more egregious misfeatures. However, merging can still be pretty difficult in Subversion.&lt;/p&gt;&lt;p&gt;I prefer to use a system allowing easy merging, such as &lt;em&gt;svk&lt;/em&gt; or &lt;em&gt;bazaar&lt;/em&gt;. Because so many of us use laptops these days, disconnected operation is also a huge boon. &lt;a href="http://bazaar-vcs.org/"&gt;Bazaar-NG&lt;/a&gt; offers both repository-oriented and completely decentralized operation, giving the best of both worlds. It also wins the competition for least setup overhead.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Virtualization&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Previously a high-powered technology, cheap virtualization is now with us. Many identical virtual machines can be quickly created to enable testing and experimentation. Deployment to virtual machines can enable hardware independence for applications, reducing another big headache.&lt;/p&gt;&lt;p&gt;Large organisations have it within their reach to bring new hardware online easily, and have invested much in management systems for it. Virtualization brings this in reach of small and one-man development teams.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Desktop-based virtualization&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Systems such as VMWare and Parallels untether developers from their desks. I use the OS X desktop daily for its productivity software, but an Ubuntu virtual machine for a large proportion of development work. A simple keypress lets me flick between the two. The advantages of multiple desktops to hand for web development are well known. (In fact, thanks to WINE and &lt;a href="http://www.tatanka.com.br/ies4linux/index-en.html"&gt;IES4Linux&lt;/a&gt; I can run Internet Explorer cheaply too from the same virtual machine).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Xen virtualization&lt;/em&gt;&lt;/p&gt;&lt;p&gt;After the initial novelty wears off, one of the most tedious tasks in the world is bringing new machines online. Combined with the tendency development environments have to get crufty as new ideas and tools are tried out, this makes for increasing disparity between the development and deployment environments.&lt;/p&gt;&lt;p&gt;Wouldn't it be nice just to take a clean machine off the shelf, check out the source, and pick up again? Using &lt;a href="http://xensource.com/products/xen/index.html"&gt;Xen&lt;/a&gt; for Linux, this cheap virtualization is possible.&lt;/p&gt;&lt;p&gt;Sadly, Xen isn't yet a packaged part of Ubuntu, but getting it up and running on Ubuntu Dapper isn't too hard. Warning: here's where things get pretty deep. Skip this bit if you're not interested in the nitty-gritty.&lt;/p&gt;&lt;p&gt;I followed these steps:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Followed &lt;a href="https://wiki.ubuntu.com/XenVirtualMachine/XenOnUbuntuDapper"&gt;instructions in the Ubuntu wiki&lt;/a&gt; to get the first domain (vm) up and running&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Installed the &lt;em&gt;xen-tools&lt;/em&gt; package, which provides wrappers for easily creating virtual machines&lt;/li&gt;&lt;li&gt;Adjusted some of the &lt;em&gt;xen-tools&lt;/em&gt; configuration (&lt;em&gt;/etc/xen-tools/hook.d/20-setup-apt&lt;/em&gt;) to set up for Ubuntu rather than Debian&lt;/li&gt;&lt;li&gt;Once the virtual machine was made, adjusted its config to allow for the kernel initrd and configure the network bridge I was using&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;Getting over the DNS mountain&lt;/em&gt;&lt;/p&gt;&lt;p&gt;If you want it to be easy to bring new virtual machines up and down, you need to adopt a different approach to managing your DNS. You need to know how to predictably connect to a virtual machine. Yet it's going to get very boring and error prone to manage the IP address space manually in your DNS, or even to map the MAC addresses of your virtual machines in your DHCP configuration.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Help is at hand in the form of mDNS (also known as Rendezvous / Bonjour / ZeroConf). In the host machine, and in each virtual machine, I ensured the &lt;em&gt;avahi-daemon&lt;/em&gt; and &lt;em&gt;avahi-utils&lt;/em&gt; packages were installed, providing mDNS services. (You should also check that &lt;em&gt;mdns&lt;/em&gt; is present in the hosts entry of &lt;em&gt;/etc/nsswitch.conf&lt;/em&gt;).&lt;/p&gt;&lt;p&gt;What all this does is allow the machines (virtual or otherwise) on the network to resolve names using mDNS. So if I create 3 VMs, &lt;em&gt;alpha&lt;/em&gt;, &lt;em&gt;beta&lt;/em&gt; and &lt;em&gt;gamma&lt;/em&gt;, I can access these right away using the hostnames &lt;em&gt;alpha.local&lt;/em&gt;, &lt;em&gt;beta.local&lt;/em&gt; and &lt;em&gt;gamma.local&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;Hey presto! Easily make machines appear and disappear without any need for sysadmin involvement. All the extra steps to add &lt;em&gt;avahi&lt;/em&gt; installation can be easily scripted with &lt;em&gt;xen-tools&lt;/em&gt;, to reduce the number of commands needed to birth a new machine to one.&lt;/p&gt;&lt;p&gt;With this ease of creating new machines, it's much more straightforward to experiment with server topology and conduct experiments on server environments.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Agile development is necessarily constrained by the infrastructure on which it is conducted. The infrastructure itself is constrained by the tools and platforms of choice.&lt;/p&gt;&lt;p&gt;By appropriate tool choice we can reduce the commitment and overhead of infrastructure. This enables developers to get on with the job they do best, and makes experimentation and evolution of infrastructure much simpler.&lt;/p&gt;&lt;p&gt;When programming, it's dangerous to fall in love with your code, as the best solution may often involve throwing half of it away. The same hazard exists with infrastructure, with bizarre and awkward effects propagating back into code and operations. Get yourself a low commitment, agile environment, and you'll be able to keep up with the pace.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://times.usefulinc.com/2006/06/17-agile-infrastructure#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Firebug: neutralizes nasty niffs</title>
    <link href="http://times.usefulinc.com/2006/01/22-firebug" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/835</id>
    <updated>2006-01-22T18:01:31Z</updated>
    <published>2006-01-22T14:13:46Z</published>
    <summary>Firebug is an essential addition to any web developer's arsenal: finally a single place to discover those coding errors so politely ignored by your web browser.</summary>
    <category term="programming"/>
    <category term="firefox"/>
    <category term="ajax"/>
    <content type="html">
   &lt;p&gt;Sometimes, coding for the web is like having a co-worker with a body odor problem. Everyone's far too polite to say anything, so you all put up with it and nobody tells the poor smelly soul. Meanwhile, they sense something's wrong but don't know what.&lt;/p&gt;      &lt;p&gt;Web browsers are so insanely great at making sense of tag soup, that if you code only for the end-result--a reasonable strategy, adopted by most when starting out--you can get into all sorts of tangles. Misery ensues: you're stuck with days of fiddling in the dark. You know something's up, but it's hard to see what's going wrong.&lt;/p&gt;   &lt;p&gt;In that sense, browsers are lousy at one half of &lt;a href="http://en.wikipedia.org/wiki/Robustness_Principle"&gt;Postel's law&lt;/a&gt;. They get the &amp;quot;liberal in what you accept&amp;quot; bit right, but they don't help the developer one bit in implementing &amp;quot;be conservative in what you do.&amp;quot; Using three or four different validators for HTML, CSS, etc. often helps a lot, but the state of the browser as an integrated development platform leaves something to be desired.&lt;/p&gt;     &lt;p&gt;&lt;a href="http://www.joehewitt.com/software/firebug/"&gt;Firebug&lt;/a&gt; is a Firefox extension that goes a long way to providing integrated web application debugging. It is a full-featured error console that shows your errors in Javascript, CSS (a godsend!) and XML. Not only that, but it does full logging for &lt;em&gt;XMLHttpRequest&lt;/em&gt; calls, so it's a powerful tool for debugging AJAX applications as well. Firebug also manages to bundle in a DOM inspector, and a command line for evaluating Javascript.&lt;/p&gt;     &lt;p&gt;With these features, Firebug should let me throw out about four separate extensions I already had installed that do a similar thing. The final star turn in Firebug's act is a Javascript call to log information to its console, the equivalent of the all important debugging &lt;em&gt;printf()&lt;/em&gt; call in C. I hope this means this will make it easier to deploy things such as &lt;a href="http://ajaxpatterns.org/Browser-Side_Test"&gt;unit test frameworks&lt;/a&gt; for AJAX applications.&lt;/p&gt;     &lt;p&gt;&lt;img width="320" height="230" alt="Firebug in action on the BBC home page" src="http://times.usefulinc.com/asset/name/13/firebug.png" title="Firebug in action on the BBC home page" /&gt;&lt;/p&gt;     &lt;p&gt;Although its author Joe Hewitt cautions us to remember that Firebug is still an alpha release, I'd still recommend rushing to install it. If you're developing anything for the web browser this year, it's the most important tool you'll find.&lt;/p&gt;     &lt;p&gt;While it won't rid you of the problems of cross-browser compatibility, Firebug will speed you in uncovering the smelly bits of your web application.&lt;/p&gt; &lt;p&gt;&lt;a href="http://times.usefulinc.com/2006/01/22-firebug#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Why Rails?</title>
    <link href="http://times.usefulinc.com/2006/01/21-rails-zope" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/833</id>
    <updated>2006-01-21T22:50:53Z</updated>
    <published>2006-01-21T11:43:56Z</published>
    <summary>When I moved my blog to Rails from Zope, I was asked why. This is a brief explanation.</summary>
    <category term="programming"/>
    <category term="rails"/>
    <category term="ruby"/>
    <content type="html">
&lt;p&gt;When &lt;a href="http://times.usefulinc.com/2006/01/15-redesign"&gt;I moved this blog&lt;/a&gt; from being Zope-backed to using Rails several people got in touch to ask why. This is a brief explanation of why I've moved.&lt;/p&gt;&lt;p&gt;Firstly I should point out I've had a long and mostly happy experience with Zope. I got into Zope originally because I'd spent some time in constructing web frameworks from scratch (we're talking 1995-1999 here) and found that not only does a framework need good templating, it needs reusable components within that.&lt;/p&gt;&lt;p&gt;Zope seemed like a good fit, so I spent some time getting up to speed and was happy there. However, there were some things that didn't make me feel completely comfortable. Zope offered a very stark choice between developing through the web based interface (DTML methods, etc.) and writing raw Python. To do really useful stuff, you had to get into the Python side of things, but also learn a lot about Zope guts that wasn't really well documented.&lt;/p&gt;&lt;p&gt;I spent more time than I probably should have had to reading Zope's own source code in order to figure out how things worked. Fine, for my own silly little projects, but not practical in general. It was hard to get the overall view of a project, and hard to test. The learning curve was a little too steep, I suppose.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So, once I'd got to a certain point I stopped, and looked around for a platform that gave me more code visibility and testability. Loyal readers will know I've looked at &lt;a href="http://times.usefulinc.com/2005/03/06-queetah"&gt;ASP.NET and Python, Quixote and Cheetah&lt;/a&gt;. ASP.NET I rejected because I didn't view Mono's web application server as mature enough at the time, and I also had reservations about ASP.NET's non-free baggage. Python, Quixote and Cheetah looked a lot more friendly.&lt;/p&gt;&lt;p&gt;What I wrote about Quixote and Cheetah at the time was &amp;quot;this combination isn't adequately presented and described anywhere.&amp;quot; These were good technologies, but not integrated as a framework. I started work on integrating them, and made some interesting progress. I was correct that Python lacked a solid modern framework, and the time was certainly right for it, as we can now see by the emergence of &lt;a href="http://www.djangoproject.com/"&gt;Django&lt;/a&gt; and &lt;a href="http://www.turbogears.org/"&gt;TurboGears&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;However, at the same time I started looking at Rails and found out that it did pretty much what I wanted. To be honest, I'd avoided it for a while as a friend once did me the disservice of calling Ruby a cross between Python and Perl. &amp;quot;Why ruin Python?&amp;quot;, I thought. And it takes me a while to get over the hype barrier before I conclude that there's a &amp;quot;there&amp;quot; there.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;Now I've been using Rails for a while, I find its attractions have changed for me. The thrill of not having to write basic functionality over and over again has given way to more select pleasures. Writing in Ruby itself is a rewarding experience, as its idioms become plainer over time.&lt;/p&gt;&lt;p&gt;Sure, you can write Java or Perl in any language, and that's where I started off. But the subtle elegance of the Ruby idiom is a slowly appreciated and highly satisfying flavour. For developers who consider themselves as poets and artists too, I can't think of a better language.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://times.usefulinc.com/2006/01/21-rails-zope#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Rails, Bazaar and SwitchTower</title>
    <link href="http://times.usefulinc.com/2006/01/19-switchtower-baz" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/831</id>
    <updated>2006-01-19T12:14:49Z</updated>
    <published>2006-01-19T12:00:18Z</published>
    <summary>A module for SwitchTower so you can deploy your Rails applications using Bazaar.</summary>
    <category term="programming"/>
    <category term="rails"/>
    <content type="html">
    &lt;p&gt;I have just submitted &lt;a href="http://dev.rubyonrails.org/ticket/3533"&gt;an enhancement&lt;/a&gt; to &lt;a href="http://manuals.rubyonrails.com/read/book/17"&gt;SwitchTower&lt;/a&gt; to let you use &lt;a href="http://bazaar.canonical.com/"&gt;Bazaar&lt;/a&gt; as a source control system.&lt;/p&gt;       &lt;p&gt;SwitchTower is a deployment framework for Ruby on Rails applications, allowing fine-grained control over deployment of Rails applications to one or many servers.&amp;nbsp;&lt;/p&gt;     &lt;p&gt;My &lt;a href="http://dev.rubyonrails.org/ticket/3533"&gt;contributed module&lt;/a&gt; lets people who use Bazaar join in the fun. Until such time as my patch is approved, save it in the &lt;em&gt;app/switchtower/scm&lt;/em&gt; directory of your Rails app. The module assumes that the Rails application is in the root of your tree.&lt;/p&gt;   &lt;p&gt;In your SwitchTower &lt;em&gt;deploy.rb&lt;/em&gt; file, add:&lt;/p&gt;   &lt;pre&gt;set :repository, &amp;quot;you@example.com--archive/whatever--trunk--1.0&amp;quot;&lt;br /&gt;set :scm, :baz&lt;br /&gt;set :checkout, &amp;quot;export&amp;quot;&lt;/pre&gt;  &lt;p&gt;The &amp;quot;export&amp;quot; setting can be omitted if you really want baz to check out all the &lt;em&gt;{arch}&lt;/em&gt; directories full of version control junk onto your live servers.&lt;/p&gt;   &lt;p&gt;Note that the repository follows a specific version. If you branch your deployed version, you'll need to change the repository to the new version.&lt;/p&gt; &lt;p&gt;&lt;a href="http://times.usefulinc.com/2006/01/19-switchtower-baz#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
  <entry>
    <title>Planning programming projects</title>
    <link href="http://times.usefulinc.com/2005/06/11-stuckness" rel="alternate"/>
    <id>http://times.usefulinc.com/public/read/795</id>
    <updated>2005-06-11T11:47:12Z</updated>
    <published>2005-06-11T11:47:12Z</published>
    <summary>Musings on managing programmers, prompted by a post from John Cowan.</summary>
    <category term="programming"/>
    <content type="html">
&lt;div&gt;
&lt;p&gt;This small article from John Cowan, 
&lt;a href="http://recycledknowledge.blogspot.com/2005/06/flow-stuckness-and-interruptions.html"&gt;Flow, Stuckness, and Interruptions&lt;/a&gt;, is
one of the most useful and pithy explanations I've
ever seen of the difficulty of managing programming
projects.&lt;/p&gt;
&lt;p&gt;My recent return to managing a team of people has 
highlighted for me the difficulties of the arbitrary
deadline approach to project management. Unfortunately, it's also the default management
approach applied by a lot of people, because the
concept is easy to grasp.&lt;/p&gt;
&lt;p&gt;The arbitrary deadline method is troublesome because 
of the difficulty of estimation.  As John's post
elaborates, you can never foresee all of the problems you'll meet along
the way.  The distressing inevitability of 90% of the effort being
required by 2% of the deliverable is 
frequently inexplicable to developers themselves. Never mind the managers remote from
the development!&lt;/p&gt;
&lt;p&gt;I found this part rather interesting:&lt;/p&gt;
&lt;p&gt;&lt;blockquote&gt;A relatively successful model for programming management, 
however, is based on the notion of trouble-ticket
tracking. Since projects are not for the most
part self-generated but rather arise out of
requests from editorial, sales, or customers
directly, each of them can be treated as a trouble ticket at whatever
scale, and then the question becomes not "Is this
project past its highly arbitrary deadline?" but
rather "How many projects being starved of the time
and attention they need?"&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;Of course, to some people the answer will always
be "all of them."&lt;/p&gt;
&lt;p&gt;Blogs, books and forums are full of sage advice
and new methods to solve problems like this
one.  They're great, until you put them into
your own situation, and find that it's not
just about technique.  
(Hurrah for &lt;a href="http://basecamphq.com/"&gt;Basecamp&lt;/a&gt;,
which pushes communication as a primary tool
of project management.)&lt;/p&gt;
&lt;p&gt;Every little thing can help though.  Best
practice for me tends to be a mongrel creation,
containing many contributions from the 2% of
residual wisdom that sticks with me from every new good idea.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A note on flow and interruptions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Danny O'Brien's &lt;a href="http://www.oblomovka.com/code/webolodeon.php3"&gt;Webolodeon&lt;/a&gt;
is a gentle way of forcing web browsing behaviour
into useful patterns.  Self-interruption is as big
a problem as external interruption when it comes to
staying in the "flow".  Now, all we need is one
of Danny's gadgets fixing to the RSS readers as well.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="http://times.usefulinc.com/2005/06/11-stuckness#disqus_thread"&gt;Join the conversation about this post&lt;/a&gt;&lt;/p&gt;    </content>
  </entry>
</feed>
