| Rod Waldhoff's Weblog |
|
|
Rod Waldhoff's Weblog Wednesday, 27 August 2003
Everything new is old again #
Recently, Daniel, Ted, Andy and James all point to a post by Tom Lord over on the arch-users mailing list. Tom's comments are made in the context of Red Hat's agreement to distribute Sun's JVM as part of their "Enterprise Linux" offering, a story that (although I regularly program in Java and I'm writing this post on Red Hat box) quite frankly I haven't been following at all. Much of what is interesting about Tom's comments may be a function of reading them outside of this context. I find this a striking post, among other reasons, because it raises several distinct responses from me:
Friday, 22 August 2003
The Social Life of Paper #
The Social Life of Paper: Looking for method in the mess, an essay by Malcolm Gladwell, is fascinating from a number of perspectives.
[Via Jay Fienberg's iCite.net] Don't ask yourself what the world needs... #
Don't ask yourself what the world needs. Ask yourself what makes you come alive, and go do that, because what the world needs is people who have come alive. An anonymous quote cited by Condredge Dole on Ward's Wiki. Wednesday, 20 August 2003
A Solution to Kata Fifteen #
What fun! Dave's latest Kata is a little math problem, and it features everyone's second favorite example of recursion.
Flexing the "proofs" part of my brain for the first time in long while, I think I've got both the solution and a proof for this. I've developed this solution independently, so there are probably more elegant proofs available. Spoiler Warning: If you'd like to work this Kata yourself, beware, spoilers follow. I'll leave some blank space first.
...
spoilers follow
...
Definitions and NotationFirst, let's define some terms.
Let
Let By inspection, it's easy to work out the first few values of f(n). Note that when n=0, we can count the empty sequence.
To make the proof a little bit easier, I'll introduce some additional notation.
Let concat(a,b) be a
function that maps a pair of sequences to a new sequence by prefixing the first to the second. For example,
Let CONCAT(a,B) be
function that maps a sequence and a set of sequences to a new set of sequences obtained by prefixing the sequence
a to each sequence in the set B. In other words,
The TheoremIf you're familiar with it, it is easy to recognize f(n) to be the Fibonacci Sequence, at least for small values of n. So here it is in theorem form: If f(n) is the number of binary sequences of length n that do not contain two consecutive 1 bits, then: f(0) = 1 f(1) = 2 f(n) = f(n-1) + f(n-2) for all n > 1 The Proof
That
Note that the set Sn = CONCAT(0,Sn-1) union CONCAT(1,Sn-1)
Similarly, CONCAT(1,Sn-1) = CONCAT(11,Sn-2) union CONCAT(10,Sn-2)
Hence Sn = CONCAT(0,Sn-1) union CONCAT(11,Sn-2) union CONCAT(10,Sn-2) For convenience, let's name each of those three sets: Let A = CONCAT(0,Sn-1) Let B = CONCAT(11,Sn-2) Let C = CONCAT(10,Sn-2) Sn = A union B union C
Since the sets A, B and C represent a proper partitioning of
How many sequences in A are in
How many sequences in B are in
How many sequences in C are in
Hence: Fn = CONCAT(0,Fn-1) union CONCAT(10,Fn-2) and
f(n) = |Fn|
= |CONCAT(0,Fn-1)| + |CONCAT(10,Fn-2)|
= f(n-1) + f(n-2)
Q.E.D. Comments
For some reason, I had initially thought I'd be clever and reverse the problem. Why count the number of sequences that don't meet some condition, but instead count those that do? This yields the sequence 0, 0, 1, 3, 8, 19, .... Other that starting with the Fibonacci-like 0, 0, it didn't seem recognizable at all to me. (More generally, this sequence is Tuesday, 19 August 2003
David Byrne on PowerPoint #
Via Wired, David Byrne on PowerPoint:
Monday, 18 August 2003
Adaptive vs. Predictive Planning #
At my day job, we develop what seems to be a wide variety of systems: several subscription based web sites, a suite of desktop applications, an e-commerce system for selling both subscriptions and physical products, and various financial, administrative, content management, editorial and reporting systems for supporting them. We've been developing most of those systems under a locally adapted form of XP for about three years now. For a lot of what we do an agile process works well. We're often making "small" modifications to a running (production) system, so a process that allows the customer to say "here's a set of changes, implement and deploy them in the next couple of weeks" fits our needs rather well. Even the least imaginative customer is typically able to break down large changes into an incremental series of small ones, and is often happy to see the intermediate steps in a running (although not always production) system. Allow me to call this approach "adaptive" planning. (I don't think I'm the first to do so.) An interesting feature, perhaps the defining feature, of this adaptive approach is that customer is often defining new requirements as we're implementing the old ones, so that we're not always exactly sure where we're going when we start. It's sort of like a hill climbing approach: we take a few steps in what seems to be the right direction and then reevaluate. Our plan adapts to changing business requirements and generally doesn't try to look very far ahead in any detail. It doesn't take a lot of insight to see that an adaptive approach is well suited to what might be called "product" as opposed to "project" management. If one conceives of the system as long-lived, constantly improving entity, it's easier to be comfortable with an iterative development process. No one can really foresee where the system is going to end up anyway, so the urge to ask "when is it going to be done?" is lessened. On the other hand, there are times when the customer wants, or at least thinks he wants, a more predictive planning process: "Here's a large set of requirements, when are they going to be met?" This question is important because the answer will often drive business deals, strategic planning, and revenue projections. Depending upon the time sensitivity of the opportunity, the answer may determine whether the project is worth initiating at all. Frankly, I don't think our process is very good at answering this sort of question. In practice, the way we approach such a question is quite similar to most "traditional" methodologies: we'll collect coarse grained requirements and prepare coarse grained estimates for them. This process is often time consuming--the customer team will spend weeks struggling to define and communicate a "base" set of requirements for estimation purposes. The result is often unsatisfactory--poorly understood and poorly articulated requirements lead to poor estimates. One solution is to somehow dissuade the customer from believing that he needs detailed planning or long term predictions. Sometimes it really is a distinction without a difference--we're going to do the work anyway, so knowing precisely what features make it into the version 1.0 release or precisely when this release will occur are details that can be determined later. Most projects end with some negotiation of scope and schedule anyway. The trouble is, sometimes accurate predictions really do matter. Another solution is to accept the limitations of this predictive approach--we don't really know how long it will take to complete the project, or what "complete" really means in the first place, so the best we can do is take an educated guess and know that the margin of error (and therefore the risk) is high. True as it may be, this answer is unsatisfactory at best, and unacceptable at worst. The fact that traditional planning approaches don't fare much better is little consolation. We've been through this "predictive" planning exercise perhaps four times in the past three years, and have found it to be successful, but only moderately so. Increasingly I am beginning to believe that the adaptive process may be a more effective way of arriving at accurate predictions anyway. Through a lack of information, insight, or political capital, I've never seen it played this way, but I'm beginning to think this is the right approach: Rather than spending a couple of weeks (or more) trying to determine a rough but "complete" estimate for the total cost of the project, spend that time developing an implementation of some of the base features (call it a "spike solution" or prototype if that helps, but it's really neither of those things). The requirements will certainly be incomplete, maybe even wrong. The implementation is likely to be wrong too, or will be when the requirements are better understood. I think that that may not matter. Part of what leads me to this conclusion is that this is what we really do anyway. Although the thought is "let's not go down this road until we're sure that's what we want to do", in practice what we'll struggle to determine what the "total cost" of the project is going to be until it becomes clear that if we don't initiate the development soon, we won't be able to hit the requisite dates anyway. We may only be 60% sure that the project is worth pursuing, but the schedule eventually makes the decision for us. Indeed, this is how we first adopted an XP practice: as a way out of the "analysis paralysis" threatening a major product initiative. (This last-minute adaptive approach is expensive in at least a couple of ways. Firstly, by the time a deadline is looming, we no longer have the luxury of slowly ramping up size the development team, we need to throw all our developers at the system immediately. This is a chaotic way of doing green-field development. Secondly, when we follow this approach, it's rarely the most important features we attack first, it's the ones that are easiest to define.) I think this "just get started" approach may bring several benefits over a predict-then-implement one. Having a working system, however rudimentary...
Of course, the customer team can in parallel continue to define and refine the requirements and seek a "total cost" estimate, but at least for these first few iterations, we don't need to worry too much about the total scope of the project There is some risk here, namely that after a couple of weeks of development it becomes clear that this is not a project worth pursuing and hence the development effort in those first few weeks is wasted. I can't imagine that this cost is significantly greater than the cost of the predictive analysis, but for better or worse in my environment there is a general impression that development resources are precious and hence need to be conserved--it's better to waste "analysis" time than "development" time. Overcoming this impression may be the key to selling this approach. Looking over what I've written here, it looks like I'm describing a straight-forward XP process, and perhaps I am. In some ways, the distinction may be in the reasons for the adaptive approach. In our typical agile project, we sell the just-in-time requirements definition process as a way to get development moving while the business is still working out requirements. When predictive questions are asked, the business often believes that the requirements are already defined (although in practice they're often not as well defined as the customer may believe), only the technical cost needs to be determined. In this case the iterative development cycle may be more valuable to the technical team than to the business. It may be interesting to explore how to use an adaptive planning process to answer predictive planning questions. Friday, 15 August 2003
Commons Logging was my fault #
I'll come right out and admit it: commons-logging, at least in its initial form, was my fault, though probably not mine alone. Back in 2001 I did a fair bit of work refactoring and debugging commons-httpclient. As part of that effort, I replaced a custom setDebug()/System.out.println based logging system with log4j. I did this for several reasons but all of them come down to the fact that a fully-fledged logging system is often quite useful. In fact, that debugging effort probably wouldn't have happened without it. This change turned out to be controversial, and a runtime dependency upon log4j was in fact vetoed. After an enormous amount of discussion, not all of it pretty, a compromise was finally agreed to. This compromise basically said (a) use a thin wrapper around either log4j or the System.out logging initially implemented and (b) allow the user to specify whether to use log4j or System.out.println based upon a method call (inversion-of-control style I guess) or an external property. I did the first implementation of this. It was later suggested, probably reasonably so, that this "log wrapping" package be extracted from httpclient for use in similar circumstances. In a more robust or complicated form (depending upon your perspective) this eventually became commons-logging. For all its warts, this brief history of Commons Logging shows the "bazaar-style" of open source development working as it should: the operative word here being "compromise". Personally, I don't believe it to be especially important that Jakarta Commons committers be able to express their creativity by the selection of logging frameworks. I'd have been happy simply using log4j, and I think Ceki's work with the "light" log4j-ME would have been sufficient to address most of the technical concerns raised. Yet others disagree, and I'll respect that position. Certainly respect for that position has encouraged advocates of alternative logging implementations to participate more fully in Jakarta Commons. That said, I think Hani and Glen miss the point entirely. The purpose of Commons Logging is not to isolate your code from changes in the underlying logging framework. (That's certainly easy enough to do on your own, and not really worth doing in the first place given the ease of switching from one logging framework to another.) The purpose of Commons Logging is not to somehow be more useful than actual logging frameworks by being more general. The purpose of Commons Logging is not to somehow take the logging world by storm. In fact, there are very limited circumstances in which Commons Logging is useful. If you're building a stand-alone application, don't use commons-logging. If you're building an application server, don't use commons-logging. If you're building a moderately large framework, don't use commons-logging. If however, like the Jakarta Commons project, you're building a tiny little component that you intend for other developers to embed in their applications and frameworks, and you believe that logging information might be useful to those clients, and you can't be sure what logging framework they're going to want to use, then commons-logging might be useful to you. On a slightly unrelated note, I think that Hani's post fails to adequately explain how the problems caused by trying to integrate systems that use incompatible versions of the same component are unique to Commons Logging. If you want a discussion of the technical issues with Commons Logging, which are quite genuine, there are much better analyses available. Thursday, 14 August 2003
A chemist, a physicist and a computer scientist were traveling in a car... #
I have to give a product demo this morning. Although I hope I don't need to use it today, I'm reminded of a little joke I used to tell back in my consulting days to keep the customer occupied when a problem forced me to do an unexpected restart, reboot or reinstall in the midst of a demonstration:
Monday, 11 August 2003
Quickie Radio Tidbits #
When I get a chance, I'll type these up for my Radio Tidbits page. PS: I'd love it if someone could point me to a definitive reference to Radio's scripting language. Friday, 8 August 2003
In Defense of XML #
Recently I've read a number of comments (some old and some new) that take issue with the use of XML for one purpose or another (in the above examples, Ant and Jelly scripts, respectively). In fact, it seems all the cool kids are XML detractors these days, although the coolness may have peaked a few months ago, when even Tim Bray was admitting that XML may not be as nifty as first thought. Now, I'll certainly admit that XML has its drawbacks. Is it overly verbose? Often. An equivalent s-expression syntax would be more concise and (for Lisp developers at least) more useful. Is it hard to read? At times. It's certainly better suited for documents where the ratio of text to tags is high. Is XML often used for developer convenience at the expense of user convenience? Is there information that has no business being in an XML format, but that developers or vendors insist on making XML anyway? Yes, yes, of course. (On a related note, if "executable XML" is such a bad idea, how does one explain the longevity of Lisp?) Despite these limitations, there is some value in selecting XML over, say (as Andy Hunt suggested for Ant) some arbitrary context-free grammar. Part of this value is the ease with which a developer can drop in an XML parser, but that's only an indirect source of value. Part of this value is the comfort that users familiar with popular SGML applications (read "HTML") have with the angle bracket notation, but that may only explain the quick adoption. The real value of XML is in the tool chain. Suppose Ant had been based upon some custom, non-XML grammar. What would we lose? Well for one, nearly every programmer's editor has a syntax coloring, well-formedness-checking mode for XML (certainly emacs and vi, or at least vim, and nearly anything that calls itself an IDE). Moreover, many editors support DTD or Schema validation as well, perhaps even tag and attribute completion. Using an XML format means a host of editors can handle Ant scripts smartly. The same would probably not have been true, at least initially, with some arbitrary grammar. How does this come about? Well in part because XML is a popular format, but also because of the ease with which a developer can drop in an XML parser and other libraries. For another advantage, consider the plethora of XML-based or XML-extending specifications. Many commentators have looked at that dense diagram and scoffed: not everything is well suited for an XML representation. Yet few would deny that at least some of those technologies do something truly useful. Similarly, consider the number of tools, libraries and technologies that implement those specifications or provide other XML utilities. Want a pretty printer? There's a tool for that (indeed you're probably using one right now). Want an API for processing arbitrary XML? There's several, in nearly any language you can name. Want portable validation? Want to combine dialects? Want to translate one schema to another? Want simple macro support? Want to embed or link sub-documents? Want to generate hyperlinked documentation for a script or it's syntax? There's a tool for that too. Sometimes it's sufficient to be adequate and popular, when that means a strong tool chain comes along for the ride. Sometimes worse really is better, or at least good enough. Clover Plug-in for Eclipse (and NetBeans) #
|
recent posts
Currently Reading
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
© Copyright 2003 Rodney Waldhoff.
Last updated: 12/8/2003; 10:42:14 AM. |