[ Content | Sidebar ]

conservative bloggers

November 25th, 2005

I hear about these conservative bloggers, but I almost never run across them. The one exception is Uncle Bob, who posts on the Object Mentor blog; I read that for the software development insights (and Uncle Bob knows much more about that than I do, believe me), but Uncle Bob also posts on politics there. (Which are easy to avoid from the URLs, should you so desire.)

Interesting to dip into occasionally, though I wouldn’t want to do so very often. The most recent post to catch my eye: Lies, Damn Lies, and Democrats. “The notion that the President purposely misled congress by manipulating intelligence is ridiculous and specious.” Hmm; can’t say that I agree with you there. “Congress had access to the same information that the President did.” Well, no: Congress doesn’t have the same access to intelligence agencies that the President does, and it certainly doesn’t have the same ability to influence intelligence agencies to spin their results. And it’s not like the President enthusiastically shares information: he puts out only that information that suits his purpose. Having said that, it’s hard to argue with “Congress voted for the war, and enthusiastically agreed with the mission.” Despite the president’s best efforts, Congress had enough information at the time to strongly suspect that going to war was a bad idea. Democrats still have a lot to apologize for on that front. (And many others, but that’s a separate blog post.)

One of his earlier posts, Are Agile Methods Leftist, complains against a facile linking of software development methods with politics, and rightly so. Having said that, some aspects of agile methodologies could be used in other fields, should you choose to do so. I don’t know enough about planning for the Iraq conquest to be able to divide it up into a sequence of timeboxed iterations/releases, with specific goals linked to acceptance tests. I guess the first iteration would have been to conquer Iraq, the acceptance test being that Saddam Hussein is overthrown. And we did that, and did it faster than I thought we would.

Now we’re in the middle of a sequence of iterations; the acceptance test there is for Iraq to be a self-governing democracy. I’ll admit up front that I think the notion of imposing democracy at the point of a gun barrel is self-contradictory; having said that, my understanding is that we basically did just that in a few countries after WWII, quite successfully, and I certainly applaud the goal of a democratic Iraq.

But: agile methods tell us to timebox our iterations; and if it looks like getting the desired results is unexpectedly difficult, then the customer should take that new information into account, and may change the plans if desired. So when I see the government constantly saying things like “we’ve turned the corner”, making claims that we’ve achieved milestones that, in retrospect, seem hollow, forcing semblances of democratic events to happen without substance behind them, and overriding the judgment of military and intelligence professionals, it doesn’t sound to me like a way to run a project of any sort. If that were a software project, it would be one of the ones that was “95% done” for years on end, with the programmers driven at the lash to meet unrealistic deadlines, and ultimately cancelled with nothing to show for it. (Other than its potentially ruinous cost, even in the software case; the costs in the war case are, of course, much higher.)

And his last paragraph:

We can not back down. We can not cut and run. We can not tell the enemy when we are leaving. And we can not play politics with this war.

The first two sentences sound to me like a customer shielding himself off from honest progress reports in a project. To the third sentence, I’ll just say that he has a different notion of “the enemy” than I do; while we are now the enemy of the Iraqi people, they shouldn’t be considered as our enemy, and if he thinks that we’re hurting Al Qaeda by staying in Iraq, he’s reading different news sources than I am. (Which is clearly the case.) And, as far as “play politics with this war” goes, the entire blog post is playing politics with the war, casting substantive disagreements solely in political terms! But apparently people with the wrong point of view are the only ones playing politics; people with the right point of view would never dream of such a thing, even as they directly politically attack their opponents…

rorty and latour, part two

November 25th, 2005

Something else Rorty and Latour have in common: they both answer their e-mail quite quickly. I got a short note from Rorty saying, among other things, that he particularly liked We Have Never Been Modern, and a longer note from Latour gently chiding me for completely misreading him. (“ah readers, readers…”)

Latour’s point (unless I’m misreading him again) is that he’s interested in objects, while Rorty is interested in people. He calls himself “a hard core realist”; as realists go, I’m not sure his view is entirely mainstream, but never mind that. And he really didn’t like my uses of “belief” and “conversation”, saying that Iconoclash is against belief, and “this one [Politics of Nature?] entirely against conversation”.

So I think that my view of Latour must have been tainted by my recent reading of Rorty. Having said that, I’m still having a hard time seeing them as quite as different as that – both of them argue against Platonic notions of idealism, and I’m not sure that Rorty’s conversations leading to constantly-changing webs of beliefs are so different from Latour’s networks of (among other things) propositions whose value gets revisited over and over again. I should clearly go back and take another look at Latour’s collectives (including both human and nonhuman members), though. If nothing else, I still can’t remember how Politics of Nature could be seen as “entirely against conversation”.

what i’m reading: the css spec

November 22nd, 2005

If you look at my recently read page, you’ll now see what I’m in the middle of. Which took about 5 minutes to implement.

My internet explorer problems are an IE bug: the fifth item in the list of rules in the CSS spec on float positioning says that “The outer top of a floating box may not be higher than the outer top of any block or floated box generated by an element earlier in the source document.” Which IE is violating.

I’m tentatively leaning towards giving up on using a definition list, replacing it with an unordered list that I tell the browser not to style with bullet points, and enclosing the fields in a span which I style with boldface. We’ll see. I should really get my tests in shape to not require huge amount of typing if I do HTML changes like that. (Well, a fair amount of typing, aided by Emacs keyboard macros.)

rorty and latour

November 22nd, 2005

I’ve been reading Rorty’s Objectivity, Relativism, and Truth, and he reminds me a lot of Bruno Latour, especially his We Have Never Been Modern and Politics of Nature. Both of them, as far as I can tell, see statements about science having a special direct relationship with reality as, at best, not adding anything to arguments, and, at worst, unhelpfully polemical. In contrast, both of them very much appreciate claims that we should pay attention to scientists because of the predictive value of their statements and because of the new products that they enable us to make. Also, both of them like to emphasize the role of conversations and changing webs of thoughts when discussing truth.

I haven’t seen either of them discuss the other, though. It’s not so strange that I haven’t seen Rorty discuss Latour, since the papers I’ve been reading were written just when Latour was first publishing, but the lack of the references in the other direction seems to me to be a bit odd. They’re both alive; maybe I should e-mail them to see what they think of each other.

They’re also both quite pleasant to read, as far as philosophers go; I was already pretty convinced by Latour, and Rorty has added to those convictions. I’m wondering what other philosophers I should be reading, and what other themes; I’m kind of tired of bouncing off of recent French philosophers, and I don’t feel compelled to follow epistemology any further. Any recommendations in, say, moral or political philosophy?

internet explorer css problems

November 21st, 2005

I did some more cross-browser testing; it turns out that my pages look like crap under Internet Explorer, and probably have for a while. Specifically, on the book card section of the page, the headers (Title:, Author:, etc.) look fine, but all the values are lined up horizontally in a row. I suspect it’s also interpreting some of the CSS I added yesterday differently as well, but the problems there are less severe.

Safari agrees with Firefox/Galeon, so it’s probably a bug in IE’s CSS. Which, apparently, isn’t uncommon, though all browsers have CSS bugs; it’s certainly conceivable that my CSS is wrong and that I’ve gotten lucky. I’ll have to look at the spec some more. Or maybe there’s something else – e.g. maybe IE has a default stylesheet that is being correctly interpreted (together with mine) to lead to the behavior I’m seeing, so perhaps I’d get the behavior I want if I can figure out what to override.

If anybody has any insights, here’s the relevant bits:

dl {
  float: left;
  width: 100%;
}
dt {
  float: left;
  clear: left;
  width: 100px;
  font-weight: bold;
}
dd {
  float: left;
  margin-left: 0;
  margin-bottom: 2px;
}

So the dt bits are being lined up vertically as expected, but IE thinks that the dd entries can all be placed on one line. And it’s not clear to me that that’s crazy: there’s no clear attribute there, after all.

It’s not clear what the next course of action is. It’s certainly unfortunate; on the other hand, realistically I’m the main person who looks at those pages, and I suspect that you, my beloved audience, are heavily Firefox-weighted as well. So I’m not sure that doing something about this is urgent. If I decided it’s worth changing, I can presumably generate and style CSS that doesn’t suffer this problem, but I’ve grown attached to my dl usage.

I will mull it over.

sidebar

November 20th, 2005

My pages now have sidebars. And are a bit more colorful. Yay.

It didn’t turn out the way I envisioned. At first, I was planning for there to be a darker color (grey, which turned into pink) across the top and left, and for there to be white not just in the data area but to its right and below it. I couldn’t figure out how to get that to work without using a background image, though, which I didn’t want to do. And I actually think the design that I ended up with is just as good as that would have been; as is, it’s sort of reminiscent of a card in a card catalog, which is a nice memory for people my age or older.

I also haven’t managed to control the positioning and spacing as well as I’d like. If you make your window narrower, you’ll notice that the links on the left get pushed down even while there’s still a fair amount of white space which could be compressed instead. And in my browser, the ‘dbcdb’ at the top and the links on the left have their left sides lined up, but that’s more or less by accident and fiddling with numbers; I doubt that will be true for other browsers.

So clearly I have more to learn about CSS, let alone about web design in general. Still, it’s an improvement over the extremely austere former design. Next, to start populating the list of links on the left…

2004 miranda pictures

November 19th, 2005

Most of you probably don’t care, but we’ve finally gotten around to putting up some 2004 pictures of Miranda. We don’t seem to have any 2003 pictures in digital form; some 2005 ones are coming eventually.

i miss destructors

November 19th, 2005

As threatened, I’ve extracted an HtmlWriter class. And certainly the code is an improvement, though there’s one thing about it I don’t like.

The class has a couple of core responsibilities: it knows how to close the currently open tag, and it knows how to indent. (One could argue that it’s a bit pointless to indent output intended for machines, of course.) So you can do something like this:

writer.open("body");
writer.open("p");
// Stick in more output.
writer.close();
writer.close();

and you’ll get output that looks like this:

<body>
  <p>
    // More output.
  </p>
</body>

Not rocket science, and it doesn’t even save you typing. But it does save you from counting spaces, and it clearly expresses what you’re doing.

This is fine for tags that live on a single line. But sometimes I don’t want to do that: e.g. I might want to create a line like this:

    <h1>Header</h1>

My first attempt at the corresponding code was as follows:

writer.indent();
writer.openInline("h1");
writer.print("Header");
writer.close();
writer.newline();

Which expresses what’s going on, I suppose, but it’s a lot of typing. And the first and last pairs of lines show up every time you wanted to generate output like this.

This might suggest creating a method on HtmlWriter as follows:

void printInlineElement(String element, String text) {
  indent();
  openInline(element);
  print(text);
  close();
  newline();
}

That works for the example above, but what if the text itself contains tags, as in this example:

    <h1><cite>Title</cite></h1>

We’d like all HTML tags to be generated by HtmlWriter, so we don’t want to pass in the literal string <cite>Title</cite> to printInline. But what are our other options?

One is to replace the second argument to printInline by some sort of class which has a method that to generate the text. (And that method can take the HtmlWriter as an argument.) Which is a pretty natural solution; in this instance, though, it’s really clunky to create a class on the fly when all you want to do is insert a relatively small amount of text. (Java’s anonymous classes help a bit, but not enough.) In a language with lambda, I might go this way, but not in Java.

What I ended up doing is leave printInline like above, but in addition to add static members to HtmlWriter to generate text with inline tags surrounding it. I picked this option because it was probably the simplest choice given the existing uses of HtmlWriter, but it sucks: in some places, HtmlWriter exists to accumulate HTML that you’re generating, while in other places it’s just some static functions to spit out HTML. One or the other is acceptable (though the former is preferable); both at the same time is wrong. (Not just aesthetically: it limits future possibilities, making it impossible to, say, have HtmlWriter automatically turn relative links into absolute ones, or do line wrapping, or anything else requiring state.)

If I were programming in C++, though, there would be a third, quite attractive solution. The methods open and close, or openInline and close, or indent and newline, are always designed to be called in pairs. So our C++ reflexes say: create classes whose constructor calls the first member of the pair, and whose destructor calls the second member of the pair. Which would leave us with code like this:

Line(writer);
InlineElement(writer, "h1");
// Code to generate whatever HTML we want; that code can generate text directly
// or call further methods on writer.

That’s much nicer; three lines of code instead of five, no loss of expressiveness, and it’s as flexible as you’d want. (I would probably further refactor those first two lines into a single line, but never mind that.)

But I am programming in Java instead of C++. Too bad. I do think that proponents of general garbage collection sometimes underestimate what they’re giving up (phrasing the discussion solely in terms of performance issues). If we accept that a language should provide (possibly optional) reference-counted garbage collection, then the question is whether it’s more useful to augment that with general garbage collection, or with destructors. Much of the time, I prefer the latter. And I look forward to future programming languages where I don’t have to make that choice.

(I was going to end the post there, but then I had more thoughts while walking the dogs. We already have a bigger picture available: it’s all about the ease of constructing function-like objects in various circumstances. You can even analyze the C++ case that way: the function-like object in question is the rest of the current block. So maybe you can do destructor-style programming pretty easily in languages without destructors but with lambda; and maybe in this situation, I should let people pass an appropriate function class to various methods, and also (for ease of use, so people aren’t creating anonymous classes all the time) provide some concrete classes for people to use, classes that do things like insert a bit of text or create an entity surrounding the output of a further functor class. Hmm. I guess I’ll try that and see how it works; should be fun, at least. But I should probably not let myself do that until I’ve implemented more functionality, to prevent myself from spending too much time refactoring.)

recently read books

November 13th, 2005

If you gaze upon the right side of this blog, you will now see a link to my list of recently read books.

This was a pretty interesting story to implement. XP encourages you to always do the simplest thing that will cause all your tests to pass; one of their key phrases in support of this is You Aren’t Going to Need It, abbreviated as YAGNI. The feeling is that, as long as you’re conscientious about refactoring constantly, you’ll be able to maintain a clean, extensible design at all times even without long-term planning.

One example of this is that, when I added the “Read” field, I represented the date as a string, since that was the simplest thing that could possibly work. I didn’t seriously think that YAGNI applied in that case – I was pretty sure I was going to want to eventually generate a list of recently read books, at which point I’d need to be able to sort by date – but I didn’t need it for that particular story.

But now I’ve had to write my Date class (I didn’t see any built-in classes that provided quite the functionality I needed). And doing it now instead of earlier has clearly turned out to be the right choice – while I haven’t saved any time overall (if I’d guessed at the Date interface back then, I probably would have gotten it right), it meant that I got to add the “Read” field faster than I would otherwise have been able to, which is good.

The story did, however, point out a more insteresting refactoring that it’s now time to do. When I started generating HTML pages, I thought about writing some sort of HtmlWriter class, to handle things like opening and closing elements, adding attributes to elements, indentation, etc. But I decided that it was overkill to do so at the time: all the HTML pages were for what I’m calling ‘entities’ (items in the database, such as authors, books, or series), so the structure all looked the same. And if I stuck the HTML generating code in my Entity class, I could use virtual functions to good effect to generate the HTML in a straightforward matter.

Now, however, I’m generating an HTML page that doesn’t correspond to an entity, namely the list of recently read books. Which results in a bit of code duplication; it’s not too serious yet, but it bothers me a little bit. I’m honestly not sure whether XP would have me pull out a full-fledged HtmlWriter now: the only other non-entity pages on the radar screen are other indices of various sorts (lists of authors sorted by name, books sorted by title, etc.), so maybe the simplest design would be to have an Index base class that knows how to generate HTML for indices, just like Entity knows how to generate HTML for entities, and leave it at that. But I think the current Entity class already has a mixture of responsibilities (both storing entity-related data and writing out HTML); having two classes like that, with one of their responsibilities shared, wouldn’t leave a good taste in my mouth. And XP likes your classes to have a single responsibility, and to clearly express that responsibility. So I think now is the time to pull out an HtmlWriter class.

Here, unlike the date example, YAGNI does apply: the HtmlWriter that I’m going to pull out is going to be the simplest such class to let me generate the pages in question, and won’t have all of the features that I’d earlier envisioned. And having two concrete, distinct places where I’m going to use it will help clarify its class interface enormously.

Also, having this HtmlWriter class will have other benefits. For example, I’d been thinking that it would be a good idea for my internal links to be absolute instead of relative; I’ll have to do that eventually if I decide to provide multiple ways to access single page from different locations within a directory hierarchy. (E.g. the Walter Benjamin page might be accessible both via dbcdb/1 and via dbcdb/author/walter-benjamin.) And implementing that will take five minutes once I’ve refactored out HtmlWriter: I’ll add a link prefix to the constructor and tell its openLink method (or whatever it will be called) to stick that prefix at the start of the href. (And at the start of the stylesheet link, too.) Simple.

A couple more potential refactorings made themselves known during this story, too. I have a Collection class that keep tracks of entities; it also currently knows how to write out the HTML files corresponding to the entites in the database. Which was fine when doing so was a simple loop over all entities, constructing a file name for each one and telling it to write itself to that file.

But now there’s an extra step, generating the page of recently read books. At this point, I have two methods that are more presentational, and they could both be written using Collection’s public interface. So it’s time to split out that functionality to a different class, CollectionWriter. And that class will be even more useful in the future, both when I add more indices and when I change the database storage method to use a SQL database instead of a Java file. (The latter change will probably require further refactorings, but never mind that.) I’ll probably do that refactoring now – after all, CollectionWriter will need to know about HtmlWriter while Collection won’t, so the split goes with my HtmlWriter refactoring. (Plus, it will take something like two minutes – I just have to move a handful methods to a new class and their tests to a new test class.)

And, having written the code to generate the a sorted list of recently read books (which took more steps than I expected to get right), I can see how that code will get generalized to handle other fields. Basically, I want to go through all entities of a certain type (Book, Author, whatever), and sort them by some field on that type (date, title, name). And I should be able to write some generic code to do that. Which I will do. But some other day; that can wait until I generate another index, at which point I’ll have two examples to work from and refactor out the common code.

It’s a joy to work like this; on the one hand (men), the code is clean enough to be easy and pleasant to work with, while on the other hand (de), it’s pregnant with possibilities, with refactorings lurking under the surface that I know I can carry out if I need to. I think Michael Feathers said something along the lines that you shouldn’t try to have your code always express absolutely everything it could, you should just try to make sure that it’s one refactoring away from expressing anything latent in the code. Which is how I feel about this code, and is a good rule of thumb: YAGNI suggests that too much refactoring might be a waste, but if a story appears for which the refactoring is important, you want to be able to carry it out ASAP.

And now I have an excuse to delve into web design again: there are enough dbcdb-related links that I think I could begin to populate a sidebar on my generated pages. Which I would have to style appropriately. Fun!

ant aargh

November 12th, 2005

Okay, now I’m mad at ant: I just changed a method from public to private, a method which was called by other classes, and ant didn’t recompile all the affected files: I had to wait until I got an error at runtime. So either ant doesn’t do what it should, or something’s seriously wrong with my understanding of Java.

(Admittedly, the latter is a serious possibility.)

homework

November 12th, 2005

Last year, Miranda had a couple of pieces of homework each weekend: the red bookbag, where we were supposed to read some books to her and she was supposed to draw and write about them, and the yellow folder, where she was supposed to read to us. This year, the red bookbag continued, but the yellow folder turned blue and comes home most weekdays.

On the surface of it, this is reasonable enough – who could complain about having Miranda practice reading and writing at home? But the second night of the blue folder, we already ran into problems: the book was a little harder than her reading level, so while she could struggle through it with help, it took quite a while, and wasn’t something we’d want to go through every night. Fortunately, the next day was my classroom day (I got to meet the kindergartners in her class; fun), so I asked the teacher about it. The teacher said that she didn’t want it to be a big time sink – Miranda should either read the book three times or for 10-15 minutes, whichever comes first.

And 10 minutes an evening sounds pretty reasonable; who could complain about that? It turns out, though, that the answer is “I could”; here’s why.

We wake up around 6:45am. From 6:45 to 8am, we’re trying to get ourselves fed, dressed, showered, lunches packed, etc. Then we bring Miranda to school; she’s at school and daycare all day. We get home a little after 6; we have to walk the dogs, examine the mail, check answering machine messages, take tupperwares out of backpacks, etc., so assume it’s 6:15 by the time we’re done with all that.

Miranda starts getting ready to go to bed at 8:15. So, in a weekday, I have at most 2 hours of unrestricted free time to spend with my daughter. But it’s actually a lot less than that; for one thing, cooking and eating dinner take about an hour of that time. For another thing, I usually want to spend a little bit of time relaxing right when I get home, instead of playing with Miranda. And, for that matter, Miranda frequently wants to spend a little bit of time doing something, too. So 30 minutes a day is a more realistic estimate. (For weekdays; weekends are much better.)

And all of a sudden, taking 10 to 15 minutes a weekday to do homework looks flat out insane: who, in their right mind, given 30 minutes a day to spend just hanging out with their 6-year-old daughter, would give up half of that to homework? I for one am not willing to do so.

I’m sure that her teacher hasn’t worked through these numbers (she’s fresh out of school, for one thing). We have a parent teacher conference coming up, so I’ll talk to her about it, and it will doubtless be fine. And, even if it isn’t, this is a situation where we can simply say “no”. But it really scares me: for one thing, I doubt situations like this are at all uncommon, especially with the ratcheting up of “standards” that is infesting our country, and I can’t imagine that the results are good. And, for another thing, 30 minutes already sucks; I hadn’t realized the problem was so bad.

And school can already take some amount of blame for the latter. Of course, there’s only so much that can be done: Liesl and I are going to spend most of the day at work, so even if she didn’t go to school at all, she wouldn’t be hanging out with us. But if Miranda didn’t have to be at school right at 8:10 every day, then mornings could be a little more relaxed, bed time could be pushed back a bit, and bed time could be more flexible if we wanted to do something later in the evening some day.

Given the situation, I’m not even sure what the next step should be from a tactical point of view. At first I was considering asking that the blue folders be moved to weekends instead of weekdays, like last year, but, thinking about it, I think just working through the red bookbags is probably a bit more time than I’d ideally prefer to spend on homework even on weekends, though I’m willing to do so. So I’m leaning towards explaining that we simply won’t be doing the blue folders (at least regularly; Miranda may want to do them sometimes), and leaving it at that. Liesl and I will have to think about that before the conference.

ant and junit

November 12th, 2005

After getting ant to do my compiling, I decided to get it to run my unit tests. Which it can now do acceptably, though the path was a bit rockier than I would have liked. Some steps:

  • Copy down an example from a book, mutatis mutandem.
  • Hmm: ant says it doesn’t know about the junit task. Looks like it’s an optional task, so maybe it’s in a separate rpm? After not too much searching, yum install ant-junit does the trick. A bit annoying, except that I do approve of modular architectures and packaging that takes advantage of that.
  • But ant is using GCJ while my code needs Sun’s Java 1.5. I dealt with this for the compile step; let’s see if I can deal with this for the test step? Yes, not hard to do. But it can’t find the code – is ant not passing my CLASSPATH setting to it? I guess so; how do I fix it? Not directly obvious from any of the documentation that I was looking at, but not too hard to figure out.
  • But even if the tests fail, the task still passes. The book tells me what to do about that, and how to fix it. (And agrees that’s a design flaw.) Great; now everything seems to work.
  • Except that half an hour or so later, I notice that only two-thirds of my tests are being run. I thought I verified earlier that they were all being run? There is a failing test currently – could the haltonfailure attribute really cause the test run to stop after the first failure, not after all of them? That sure sounds like a design flaw to me – if a change causes multiple tests to fail, that’s useful information. There seems to be no attribute to use that gives the behavior I want; sigh. The book, however, in its explanation of why you normally don’t want a test failure to halt the junit task (because you might want a subsequent task to format the results attractively, and then fail) shows a trick that I can use: I’ll set a property instead of halting the task when a test fails, and then the next task will fail if that property is set. Which works great.

So now everything is working fine. I’m still not overwhelmingly impressed by ant, though I imagine most tools would present similar stumbling blocks when you first learn to use them. I’m happy with the results; if I were planning to stick with Java for the long haul, I’d change things still further (in particular I’d run the acceptance tests and installation from within ant), but as is I’ll stick with what I’ve got.

benefits of white shirts

November 12th, 2005

Miranda says: it’s good to wear a white shirt on Arts Focus days, because that way if it gets dirty and the stain won’t come out in the wash, it’s like a tie-dye shirt.

One way of looking at things, certainly.

rhyming

November 12th, 2005

The rhyming bit near the start of The Princess Bride is a nice throwaway touch.

ant

November 10th, 2005

I converted dbcdb’s build system from Make to ant a couple of days ago: besides ant being on my list of tools to learn about, it seems to be impossible for Make to work well with Java. Previously, I’d gotten around this by using a Makefile that works 99% of the time, and having my first acceptance test do a make clean; make all. Which, actually, worked well enough – the project is small enough that rebuilding from scratch takes something like five seconds – but there’s no excuse for not getting your dependencies right.

Upon converting to ant, however, I ran into an unpleasant surprise: my acceptance tests were taking two or three times longer to run! After some digging around, I found the issue – each acceptance test had been doing a make, which I’d replaced by running ant, and it turns out that it takes ant about three seconds just to figure out that it doesn’t have to recompile anything. So I’d replaced one 5 second delay by seven 3 second delays; oops. (Actually, it was made worse because of a problem in my ant usage; those are the numbers after I fixed the problem.) After a bit of hemming and hawing, I’ve decided to remove the ant calls from the acceptance tests other than the first one; hardly a satisfactory solution.

Of course, an ant maven would tell me that the right thing to do is to have the acceptance tests be run from within ant, at which point dependency checking would solve that problem. Which is absolutely correct, if I were sure that I’m going to stick with ant in the long term. But I’m not at all sure of that: at some point, I’m going to switch the project to another language (Ruby is the current leading candidate), at which point I won’t have any obvious reason to stick with ant. (To confuse matters further, Ruby also has its own make replacement.) I’ll definitely add a task to run the unit tests though; it is nice that all the ant guides talk about JUnit right up front.

I’m also a bit nonplussed by the fact that Emacs isn’t handling editing the build.xml file properly; it looks like its xml mode might do better if there were a DTD that I could point it at, but apparently such a beast doesn’t exist for ant, because the language is extensible. So I have to hand-indent it, which is barbaric. Don’t get me wrong, that’s more Emacs’s fault than ant’s fault, but it’s still pretty annoying. I’m sure there’s a solution out there, but right now I’m not feeling motivated enough to go find it; I’ll limp along until it either becomes more of a problem or vanishes entirely. And I’m still make-centric enough to be not entirely comfortable with ant: for example, its lack of small-scale targets bothers me. What if I just want to compile one of my .java files (plus its dependencies, of course), not the whole batch? (Though I just read a possible solution to that, using properties.)

test blog spam

November 8th, 2005

I had been having problems with blog spam, but I’ve been mercifully free of it for a while. I’d noticed that they were spamming the same posts over and over (no idea why; I couldn’t see a pattern, though I admittedly didn’t look very hard), so I turned off comments on those posts, and they died down.

But today I got quite a bit of spam, hitting posts relatively at random. I ended up turning off comments for all posts June 2005 and earlier; hopefully that will help somewhat.

The weird thing was that the spam comments just said “testcomment” (with a number attached), and similarly the links were just test links. I don’t know what’s going on here: is some jerk testing out a spam program? Is it somebody’s idea of fun? Weird.

sudoku revisited

November 7th, 2005

I was infatuated with sudoku for a little while, but then I got bored with it: I was at a stage where puzzles were either too easy or required random searches, neither of which I enjoyed.

But I’ve started doing them again, and I would like to recommend the brainbashers sudoku web site. For one thing, their web interface is quite good, at least in my limited experience. Its default setting catches really stupid mistakes where you enter a number that’s duplicated elsewhere; those are 95 percent of the mistakes I make, and I’m quite happy to have a computer catch them for me as soon as I enter them instead of waiting until I’m almost done with the puzzle to realize that, at some point in the distant past, I screwed up. Also, it lets you enter a list of possible choices for a square, which is essential for hard puzzles. The only complaint I have is that it requires you to use the mouse, but I can deal with that – there’s enough thinking going on that I’m not clicking too much.

The other nice thing is that their hard setting is just the right level for me: I can always do the puzzles through pure logic, but I never feel insulted by them, and almost never bored, while some of them are quite tricky indeed. I have gotten better since the first time I gave up on the genre, incidentally – there were solution techniques other than random searches that I hadn’t mastered.

I’m still not sure how long I’ll keep on doing them – some of the puzzles are starting to feel a bit repetitive to me again. But I’m enjoying them for now.

jade empire

November 6th, 2005

Sitting down to play Jade Empire was a very pleasant experience. I’d just given up on a not very satisfactory game. It had been a while since I’d played an RPG, so I was primed for the experience. I selected a character without too much agonizing, entered the initial area, talked to a few people, got some hints of the world. Wandered around, got a feel for the scenery. Got some plot information, a plot-related task, a side quest. And not a single false note to be heard. I relaxed more and more, putting myself into the hands of the game; I must have played it for five or six hours that first day, which is a rarity for me.

So: what’s it like? Like Shenmue, it resembles an interactive martial arts movie, but one based on older Chinese themes instead of modern Japanese/Chinese themes. It’s perhaps a bit strange that Japanese video game studios have no compulsions about making movies based on western themes, while western video game companies don’t commonly make video games based on eastern themes.

Here, aside from making a perfectly nice world to set the game in, the choice of an eastern theme has a concrete effect on the game design. RPGs based on western fantasy models tend to have one character who is a fighter, one character who specializes on offensive magic, and one character who specializes in defensive magic. (And they typically throw in a fourth character for good measure, perhaps a thief or ranger or archer.)

This sort of specialization is, I would hypothesize (not being an expert), perhaps less a part of eastern mythological themes. (Or perhaps BioWare is counting on my ignorance, and using exoticism as a cover for opening up game play.) Your character can fight with hands, fight with weapons, cast projectile spells at enemies, heal herself, and transform into monsters, among other things. You’re free to emphasize one aspect of your character over others if you wish as you level up, but the game in no way forces you to do so.

Or rather, as you progress, not just as you level up: while your basic power improves as you level up, you gain new capabilities in other ways as well. You learn new techniques as part of quests or through purchases. You have an amulet that you can add gems to to tweak your stats. As a result, you have quite a lot of choices in you you develop your character. And those choices aren’t set in stone: you can change your fighting techniques during a match, and you can change the contents of your amulet to, be, for example, more focused on persuasion when wandering through town while more focused on defense while in a dungeon. In many ways, this flexibility in improving your character reminds me more of the Paper Mario series than of a traditional RPG (though it’s rather richer than Paper Mario); I like it. I haven’t played BioWare’s earlier Xbox RPGs, the two Knights of the Old Republic games, but I suspect that being a Jedi gives them a similar flexibility.

This, in turn, changes the plot, party, and gameplay dynamics. While most RPGs have you start off controlling a single character, and focus more on that character than other party members, you really are focused on the party as a whole (or at least the subset that you use frequently): the party members are, for example, a necessary part of any battle in a traditional RPG in order to provide you with a sufficient range of capabilities. In Jade Empire, however, your main character can do everything by herself. (Or himself; you choose your main character from several possibilities of both genders.) You do end up accumulating quite a sizeable party, but experience doesn’t apply to them, so you don’t have to worry about leveling them up. Instead, you choose one of them as a companion while wandering around, but you can change which one accompanies you relatively frequently; the companion can fight with you in the battles, but you’re always a much more effective fighter than your companion. Your companion doesn’t even have to fight: you can choose to have your companion stay out of the battle and give you support (e.g. heal you). When you do the latter (as I did for the second half of the game), your companion ends up feeling more like another form of equippable item than anything else.

This, in turn, allows your party members to play a part in the plot that is somewhat larger than in normal RPGs. Their motivations and loyalties are often somewhat unclear; and if it’s necessary for them to disappear in order to further the plot, the game can do so, secure in the knowledge that it isn’t depriving you of valuable leveled-up characters. Having said that, the game does still fall into the typical RPG trap of excessively large parties: several party members play no significant role in the plot, and wouldn’t be missed if they were removed from the game. As is, the question of “just what are these other party members doing while I’m off adventuring, and why aren’t they helping me fight my battles?” still arises.

Another huge effect of your do-it-all main character is that it frees the game from the need for turn-based combat. If your fights involve four party members, it’s hard to avoid turn-based combat. But if your fights involve the main character plus a single largely ineffective sidekick, having you directly control the main character while the computer controls the sidekick works fine. While I’m willing to play RPGs with turn-based combat, it is a drawback for me; I like this way better.

This also makes it natural for battles to take place in the normal environment, though you can’t avoid them in the way that you can avoid them in, say, Paper Mario. Fortunately, there’s rarely any need to avoid them: the battles are at set places, there are no wandering monsters, so battles never interfere with your exploration. (Skies of Arcadia still makes me shudder.)

Like BioWare’s earlier RPGs, you can play your character as good or as evil. Which is a fine feature, but not one that I’m likely to take advantage of: I basically never replay games, and in any event I don’t want to play my character as evil. Of course, like almost all RPGs, there’s one gaping hole in the notion of what constitutes good behavior: when going through other people’s houses, you’re free to break pots, open chests, and in general loot your hosts blind.

And the game made one very good design choice that is much more unusual than it should be: while it has the traditional three difficulty levels, you can change the difficulty level on the fly. I played through almost the entire game at the middle difficulty level, which was a good match. But there were two boss battles where, after struggling with them for a while, I decided that I wasn’t enjoying them, and (in one case) would probably have to replay some earlier areas to leave myself in an appropriate shape to beat them. Which I didn’t want to do. (It didn’t help that they were preceded by load screens and cut scenes that I couldn’t skip.) So I simply changed the difficulty level to easy, won the boss battles (and had fun doing so), and set the difficulty back to medium. Which was much more fun than spending an extra hour or so on those battles.

It’s a nice looking game. Though the cut scenes actually look rather worse than the in-game play; pity they didn’t use the in-game engine for more of the cut scenes, and use less compression on the remaining ones. (If one or the other is going to look good, they made the right choice; Final Fantasy this isn’t.) I have no idea why the game is rated as mature; I didn’t mind Miranda watching while I played it.

Despite the above paean, the game does have some flaws. It’s divided into seven parts; the first is a sort of training area, where the possibilities of the game are opening themselves up to you. After that comes a smallish city, and then the capital city. In both of those parts, you have a good idea of how the game works; you can do the bare minimum necessary for the plot, or you can pick up perhaps a dozen or so side quests. I chose the latter strategy; I thoroughly enjoyed it. I was wondering, however, what the next part was going to be like: the whole game so far was drawing me to the capital city, so I was curious about (and looking forward to) the major plot shift that would send me out to other cities to explore.

There was a major plot shift (which wasn’t entirely to my taste, but that’s fine); it didn’t, however, send me out to other cities to explore. Instead, parts four through seven of the game were all dungeons, with essentially no side quests to perform; all put together, they took less time to complete than part three by itself. I’m not sure what happened – maybe they had a larger game mapped out, completed the first half of the game and the dungeons of the second half, and then were forced to publish. In any event, the balance of the game ended up out of whack, and the game ended up a little short. Normally, I would be quite happy with a game that took me 15-20 hours to complete – a lot of RPGs could use some slimming down – but I was enjoying this game enough that I would have preferred a 25-30 hour game where the dungeons at the end were replaced by a couple more cities.

Great game; I wasn’t sure if I’d play Knights of the Old Republic, but if this is what BioWare is capable of, then that game has vaulted to the top of my to-buy list.

(Well, near the top of my to-buy list: I just went out and bought We Love Katamari, Shadow of the Colossus, and Pirates!. But I’ll get to it soon!)

release planning

November 4th, 2005

For months, I’ve wanted my team to try actual XP/Scrum-style release planning; yesterday and today, we actually did it. I’m glad we did; if nothing else, it was quite interesting, and I think/hope it was productive. This planning is for a “release” at the end of the month that we’ll use for demos and trials and give to our external partners for integration work. (We do such releases every month.)

We don’t have an appropriate real customer to use for planning, so my boss was doing the Customer role. Which wasn’t completely ideal (a product manager might have been a better surrogate), but was good enough, and even had its advantages given the multiple teams working on the product.

We didn’t have an existing product backlog to work from, so we started by going through the new features that were high priority, and brainstorming each enough to come up with some tasks we could work on this month. Also, we discussed some things that we might work on other than new features: refactoring, fixing bugs, improving our testing. It is a flaw in our development that we have to do any of that outside the context of adding new features; we are flawed. (But we’re getting a lot better.)

Then he went through the tasks and marked them as priority top, middle, low. We then discussed how much work we’d do this month and the extent to which we habitually underestimate (like I said, we are flawed), and came up with a budget for our estimates this month.

Then he went away for a little while and we estimated the top and middle priority tasks, and came a proposal for how much we’d like to work on the hygiene tasks (refactoring, bugs, testing). We had been worried about external dependencies for some of the tasks; we talked about where we could minimize that and where we couldn’t. And there was one high priority area where we needed outside help to break it down into tasks, since it was in an area where another team had done most of the work.

Amazingly enough, the concrete top and middle priority items used up less than half of our budget; we put in a modest but nontrivial budget for the hygiene tasks, and that still left us with a noticeable budget for the vague high priority area. So we ran this by our Customer, and he agreed that it was a good plan.

I liked the outcome a lot. It’s a workable plan; there will be surprises, but I’m pretty sure we didn’t seriously over- or underestimate how much we can get done. We’ll make concrete progress in several important areas, including some areas that I’d been nervous about starting. We have some limits in place to discourage our desire to work on what we want to instead of what is most valuable for us to work on. We did a good job of analyzing possible roadblocks and working around enough of them that the remaining issues should be manageable.

There are some improvements we’ll want to make for next time. We spent too much time breaking down big issues into manageable tasks; in the future, that breakdown should be mostly done before the monthly planning meeting. So I’ll try to meet with my boss to do some more of that, so that next month we’ll be better prepared. And maybe my team can spend a little bit more time estimating the resulting tasks in advance, to further speed up the meeting. Having said that, though, while spending half a day on this is a big chunk of time, I’m almost positive it will pay for itself quickly: if it causes our team to spend even a day working on high-priority items where, left to our own direction, we would have worked on low-priority items, that’s a win right there.

I’ll make a Big Visible Chart out of this, we’ll break it down into weekly plans, and get going; I’ll report back at the end of the month!

questionable content

November 2nd, 2005

The most recent addition to the list of web comics I regularly read is Questionable Content, and this strip is a pretty good example of one of the main reasons. I am completely ignorant about the aspects of the music scene that the characters are into, but I just like to listen to people delve knowledgeably into what the rest of the world considers trivia. It reminds me of (some of) the good parts of grad school, I guess.

It doesn’t hurt, of course, that I like the interactions between characters. And the occasional throwaway Dune reference. Though probably what really sold me was the one where somebody couldn’t get the Katamari Damacy theme song out of his or her (I forget) head. Boy, do I know that feeling.

(And I just started playing the sequel, We Love Katamari. We do, we do!)