Doing Favors

For a couple of year’s now, I’ve considered Don Lindsay’s List of Logical Fallacies to be an essential reference…especially for anyone who gets involved in discussions on the net1. I noticed that Don’s list had moved, and as I was redoing bookmarks etc. I browsed around a bit and found this article about favors. It makes a lot of sense. To put it in even more “mathematical” terms than Don does, I see two main points:

  • The more favors are done throughout a community, the more favors each member will receive.
  • The value of receiving a favor is greater than the value of doing a favor.

The first part is very closely related to Axelrod’s ideas about Evolution of Cooperation, as illustrated by the Iterated Prisoners’ Dilemma2. The second part ties that in with catastrophe theory. The idea here is that the cost of the favor is effectively zero because it does not have enough of an effect to cause a state change (e.g. from happy to sad). However, the value of receiving the favor might be of sufficient magnitude to cause a state change in a positive direction, so in effect the system (community) is getting something for nothing. I guess laws of thermodynamics don’t really apply to people.

I guess what I’m getting at, through all of these links and gobbledygook, is the idea that the world would be a better place if people looked out for other people more. In particular, people should keep an eye out for those situations where the ratio of recipient benefit to their own cost for doing something is especially high, and make a point of doing that thing even if there’s no immediate payback. There might also be some kind of lesson here regarding specialization and doing what you’re good at, but I’ll leave that for a future philosophical ramble.

1Somebody recently gave me a link to another good list of fallacies by Stephen Downes.

2Axelrod’s work was seminal in a way that very few works in any field can match, and has very broad implications from AI to political science. I highly recommend making the effort to learn what it’s all about, perhaps starting with this excellent page at Stanford, particularly the intro and the section on iteration. Interestingly, I knew Robert Axelrod a little during my time at Michigan, and also John Holland, but it was not until many years later that I realized what intellectual giants they both were. If only I’d known at the time, I would have made more of a point of asking them about their respective work and ideas.

Civilization III Revisited

Now that I’ve actually finished my first game of Civ3, here are some observations:

  • It turns out that my monitor did have the ability to display images pixel-for-pixel accurate relative to the input signal, with a black area around the edges (they call it “native” resolution), instead of scaling the image up to the monitor’s natural (“default”) 1280×1024. Quibbles about lousy terminology aside, using this setting did improve the game images a lot but didn’t totally fix them. Units are still too hard to distinguish from one another, border lines are still hard to see sometimes, and there are (of course) still only two zoom resolutions…and it’s still ridiculous that the game can’t take advantage of larger screen sizes.
  • The interface is still unwieldy. In addition to the problems noted previously, I feel like I spent way too much of my time scrolling through too-long city production lists. A little hierarchy would help here.
  • The terrain generation is awful. Both my game and my wife’s seemed to have these really big sprawly ball-of-string kinds of continents, which are just a pain. I like having two or three big continents rather than one big blob – what the game calls “Pangaea” – or lots of little islands, but I’d like those continents to be relatively compact. It also seems like the terrain gets in the way a lot more than in Civ2, with cities becoming more isolated by deserts, jungles and mountain ranges than I remember happening before. I think I’ll try selecting an older, cooler planet next time to see if it makes a difference.
  • Taking and holding cities is much more difficult than in Civ2. For one thing, artillery and bombers are much less useful, seeming more likely to kill citizens or destroy improvements than damage enemy units. As a result it’s necessary to sacrifice many more regular ground troops to take the city, and then you need even more ground troops to occupy it. If you don’t have at least as many garrison units as there are resisters in the city – ideally as many as there are total citizens – you run a very high risk of the city defecting right back to its original civilization. Note: when this happens your garrison units disappear, to be replaced by the original civilization’s units.
  • On the plus side, if it’s too difficult to hold a city you can take advantage of a new Civ3 feature and raze it to the ground instead. When you do this, the citizens become workers, so you can actually found a new city on the site of the old and then use the workers to pump the population back up. Of course you lose all improvements, but you’d lose most of them by capturing the city anyway. Unless the city contains useful wonders, this seems to be a more effective approach, and I noticed the computer players using it themselves.
  • Access to resources can be very important. I was never able to build Marines because I lacked access to rubber, and I only secured a source of coal so I could build railroads very late in the game. I can easily see this being a critical factor in a close game.

On the whole, I’d have to say I’m disappointed. It’s a very good game which presents some intresting twists compared to Civ2, so I’m sure I’ll still spend many hours playing it, but I’m not convinced that any of the differences make it a better game than Civ2. Ah, well. Maybe Stars! Supernova Genesis will be the sort of quantum leap past its predecessor that Civ2 was compared to Civ1, or maybe Master of Orion 3 will finally make that series worth playing, or maybe Master of Magic 2 will become a reality, or maybe some whole new space- or magic-themed “four-X” (eXplore, eXpand, eXploit, eXterminate) game will bring the thrill back.

Real Solutions to Terrorism

original thread

I think your list of “antidotes” to terrorism is more interesting for what it omits than for what it includes. It seems to me that one of the primary motivators of terrorism is repression on a scale of nations or ethnic groups, not individuals. In particular, envy and resentment at economic/cultural/intellectual imperialism seem to play a very large part. To that end, I think the two most important steps – both missing from your list – to prevent terrorism are:

  • Address the institutions and attitudes that lead to gross economic inequity.
  • Show people around the world a more humane, tolerant side – not just our laws and our armies.

I think everyone here probably understands what I’m getting at with the first part, so I’ll leave it there. The second part leads to a few secondary observations.

Insisting that Muslim nations accept Western attitudes toward sex and drugs will only increase resentment. The Muslim world has its own rich moral and intellectual tradition that do not encompass these things. When it comes to basic human rights – e.g. child abuse, the role of women – there’s an argument to be made for overriding local traditions and norms, but beyond that is territory where one must tread very lightly indeed. Pushing too hard on these issues shows how intolerant we are, and is likely to exacerbate fears of “cultural imperialism”.

Similarly, the push toward secularism is dangerous. The idea of totally separate church and state might seem very natural to us, but it’s a very Western construct. People in many parts of the world simply don’t see these relationships the same way we do. To a certain extent they have to make the same “evolution” following the same steps as the Western world, otherwise the more advanced lessons don’t “adhere” properly. Time after time, trying to take a country straight from a tribal/agrarian model to a secular/democratic/industrial model has failed; it’s largely how we got into the current mess.

What would help far more would be to let the “man on the street” in poor nations see Americans and Europeans helping them in long-term viable ways while respecting instead of trying to suppress local identity. If the people in Afghanistan saw more Peace Corps workers than Rangers, if they saw us helping them with micro-loans and vaccinations and deployment of cheap field-maintainable energy sources (Engineers Without Borders) instead of facilitating hegemony by our multinational corporations and their ad campaigns, that will make it very difficult for terrorists to recruit or find sanctuary. We must be international friends first, perhaps stern friends sometimes, but cultural bullying will get us nowhere.

Paying for Health Care

The problem with the US healthcare system, in a nutshell, is that too much decision-making authority rests in the hands of people who have no interest in the well-being of their subscribers. Like any other kind of corporation, insurers and HMOs are accountable to exactly one group: the shareholders. This belief that corporations cannot or should not be subject to other forms of accountability is IMO highly suspect, but that’s a topic for another essay; for now let’s just accept that that’s how corporations are and will continue to be viewed. The insurers’ responsibility to their shareholders requires that they maximize profit, which they can do either by raising prices or reducing costs. Since the market will only bear so much, they tend to focus on the cost side. One of the ways they reduce costs is by reducing service, by refusing to pay for treatments they consider as “unnecessary” according to their own complex and sometimes rather arbitrary rules. Both subscribers and providers (doctors and hospitals) often chafe at this. This is not the only way insurers try to cut costs, as some would have us believe, but it’s the kind of cost-cutting that seems to bother people so it will be the focus of this article.

The most often proposed alternative to the current system is to have the government take a larger role in paying for health care, often to the extent of displacing the current insurers and HMOs. Unfortunately, the government is not known either for efficiency or for short-term responsiveness to individual needs. Even most proponents of more government involvement in health care seem to see it as the lesser of two evils – the only alternative to the current system which is seen as broken.

Any time some people suggest more government involvement, others are quick to suggest less. The most visible counterproposal to greater government involvement seems to involve making it easier for subscribers to sue health-care providers, e.g. with a “patient bill of rights”. I guess the small-government types have forgotten that the courts are a part of the government too; in fact they’re already the slowest-moving and most overburdened part of the government, and a deluge of health-care-related lawsuits will only make that worse. The problem with this approach is that all the cards are on the insurers’ side. Health-care agreements are enormously complex, requiring a great deal of very specialized legal and medical knowledge. Anybody who has actually been involved in such a lawsuit knows how difficult it can be to figure out what these agreements really mean. It’s not sufficient just to understand the words’ common-sense meaning; one must also understand their specific and often counterintuitive legal and medical meanings as well. For example, a common word like “separation” might mean something very different to either a doctor or a lawyer than what a layperson might expect. Going through a lengthy contract sentence by sentence, word by word, to understand the implications relevant to one’s own case, is beyond almost any individual’s capabilities. It’s not just the contracts themselves, either. The contracts refer to the insurer’s health care standards, which are multi-thousand-page documents filled with medicalese. These standards are not just unimportant parts of the picture. They’re major assets held and controlled by the insurers. Normal people have effectively no chance to understand them, and even the best doctors can never be as familiar as the insurers’ own people. This creates a playing field that is always drastically tilted in the insurer’s favor, undermining the practicality of any “just sue them” proposal.

So how do we cut through the Gordian knot? My suggestion is to take advantage of one thing the government can do fairly well: standards. Instead of leaving health care standards to the insurers, the government could develop a Uniform Health Care Standard (UHCS) that defines a basic level of service. For each condition, the UHCS would specify in a standard commonly-understood (among professionals) form which treatments must be allowed under which circumstances. If necessary, it could include diagnostic criteria – as DSM does for psychiatric conditions – or refer to existing standards to determine whether a patient does in fact suffer from a particular condition. This would then eliminate the insurer’s advantage of understanding the standard better than anyone else, and also eliminate the “wiggle room” they currently build into their own standards. Note that the government would not be directly involved in enforcing the UHCS; their role is merely to provide a level playing field so that a patient who sues an insurer has firm ground to stand on and has a fair chance of winning.

I know some people hate standards. Defining such a UHCS would inevitably be a time-consuming process, and could get political. Challenges to particular parts of the UHCS would be commonplace, but the government could help by making a dispute-resolution system part of the standard. The key observation here is that the standards already exist. The only difference is that they’re private standards granting an unfair advantage to one party. It would be much better to have an open standard that applies to anyone who want to claim they’re in the business of providing health-care insurance. Developing and maintaining that one standard is still likely to be less costly than dealing with all the litigation that currently involves multiple private standards.

The other obvious objection to a UHCS is that it would prevent health-care providers from competing. That’s a totally bogus argument, since the UHCS is only a minimum standard. Insurers could still differentiate themselves by offering coverage over and above what the UHCS requires, and the differences could even be more succinctly stated when the baseline standard is understood by everyone. Companies could also still compete in other time-honored ways:

  • Reduced internal/overhead costs.
  • Lower premiums.
  • More approved providers.
  • Better customer service.
  • Advertising and marketing.

In short, the only form of competition that would be ruled out is cost reduction via denial of service to subscribers. Everything else would still be fair game. A further benefit would be that the existence of a uniform standard would spare new market entrants the expense of defining their own standards in a legally-acceptable way. This in turn could create a boom among low-end “standards compliant” insurers, increasing competition instead of allowing the current small group of insurers to continue acting as a cartel.

I Prefer Dumb Tags

Until now, I hadn’t decided how I felt about Microsoft’s new “smart tags” feature. Now that I’ve read this article at, I’ve decided that I hate them. Accordingly, the appropriate meta tag to disable smart tags has been added to all of my automatically generated code, and I encourage you to consider adding it to your pages as well.

Content Management and Distributed File

This was a response to a thread about content-management systems on the Joel on Software site. BTW, I get HTTP error 403.6 “You are not authorized to view this page” when I try to access the new version of the same site. It seems either that Joel’s IIS config is totally messed up or he’s blocking my entire IP address block. I wonder if the latter might be because my blunt commentary conflicts with the obvious goal of using a weblog/discussion site to drum up interest in one’s commercial wares – much like Dave Winer’s multiple sites devoted to exactly the same purpose in exactly the same product category.

Kyle, your comment about supporting both modes sparked a complicated train of thought in me. The links between what went in and what comes out might not be very clear, but here goes anyway.

One of the core functions of a content-management system seems to be providing a way to edit files that “live” on a web server somewhere else. Yeah, there’s other stuff – mostly templating – but I’ll get to that later. This “remote editing” functionality is valuable for one extremely temporary reason: many ISPs don’t provide anything better than FTP to get at your files. But that’s going to change. I don’t expect that hosting companies are going to be providing NFS/CIFS access for customers any time soon; any that did would get constant complaints about performance during the short time before they were dragged under by the security problems they’d be creating. However, in the next couple of years we’re going to start seeing distributed-filesystem technologies that do have the performance and security characteristics to make such remote access – from anywhere – palatable. I’m working on part of that puzzle, and I know there are many others. Maybe I won’t be “first past the post” but the post will be passed.

Once that happens, I wonder what parts of a CMS like CityDesk will still have any serious appeal. Not only the remote-access portion but all integration with it e.g. in the editor will be pretty useless. Why would I use CityDesk’s editor when I can use one I already know and like quite well? Apart from the application of templates, which can be done from a script launched with a single click from within my editor (EditPlus) I only see a couple of things CityDesk would add. One is a minor matter of mapping between the “raw” and “cooked” forms of a page so that hitting the “preview” button while editing the former will show you the latter. No offense, but BFHD. I’m sure the authors of existing editors could add that functionality to their programs in under a day; EditPlus is damn close already. The only significant part left, then, is a layer of WYSIWYG-ness to hide the icky HTML details from users.

Both WYSIWYG HTML editors and templating programs are a dime a dozen. Remote file upload is going to be a non-issue soon. Yet again I have to wonder how much consumer-perceived value there will be in a program that’s a jack of all these trades and master of none, when existing fully-formed and familiar programs that cover all of the core CMS functions can so easily be made to work together.

So long, Tony, and thanks

British grandmaster Tony Miles died today, and the chess world is much poorer for it. He was not only a great player but also a great commentator and promoter of the game, and the chess world’s definition of chutzpah. Despite all of his greater accomplishments, he will probably be best remembered for having the sheer audacity to play 1. e4 a6 as black against a sitting world champion, and win, as he did in 1980 against Karpov. How could you not love a guy who would do that?

Adding Code

Every time I get into a serious coding session, I notice certain patterns in the way I go about it. In fact, the process starts well before I actually start coding, and goes something like this:

  1. Think about how the new piece should work.
  2. Think about how the new piece will fit into existing code.
  3. Think about how I’m going to test the new piece.
  4. Write the new piece as standalone code.
  5. Write a Python wrapper for the new piece.
  6. Write a bunch of Python-based unit tests.
  7. Use the unit tests to get the new piece working perfectly in isolation.
  8. Refactor existing code to accomodate the new piece, without changing any functionality.
  9. Run full regression tests on the refactored old code.
  10. Integrate the new with the old.
  11. Run stress/regression tests on the integrated whole, debug, etc.

Quite often, the “thinking” parts of this process take longer than the actual coding and testing parts. Sometimes I get impatient, but I know deep down that if I rush into writing code I’ll just have to go back and do the thinking later when the code turns into an unmanageable mess. But then, every software engineering book pounds on that point, so that’s not new to anyone.

The thing that I don’t recall the books talking about so much is the importance of planning how to connect code into an existing program. Writing brand-spanking-new code is one skill; connecting it to other code is a different skill, and for all but the very first part of any non-trivial project it’s at least as important as the coding itself. In my experience, a high percentage of bugs – and often the worst bugs – have their origins in these points where one piece of code connects to another. Unit-testing the hell out of each piece is a great thing, but if you don’t think clearly about how the pieces go together you’re still going to have problems.

The approach outlined above, of thinking about how to connect stuff before writing the new code, and of having an explicit “make room” stage in the process has worked very well for me. It keeps large projects from turning into a tangled mess of complex interfaces and interdependencies that breed bugs. It’s a little surprising that books focus so much on how to write new code, and pretty much overlook this part of the process.

Civ3 Display Problems

It occurred to me that some of my display problems with Civ3 might in fact have something to do with my monitor. As I said, Civ3 doesn’t seem to use anything above 1024×768, and my monitor’s an LCD with a native resolution of 1280×1024. To display 1024×768 it has to do one of two things:

  • Use the whole screen, but use pixel interpolation to scale images from the smaller size.
  • Display the images pixel-for-pixel, but only use part of the screen.

My monitor is clearly using the former approach. I think it supports both, though, so maybe I’ll try tweaking it to do the latter tonight and see if I get better results.

Civilization III

I’m still in the middle of my first Civilization III game, after playing some Sunday evening and then all day yesterday. I think I’m doing well (thanks for asking) but it’s kind of hard to tell, for reasons I’ll get to in a moment. What follows are comments on some specific game aspects based on my play so far.

Pretty, but not very functional. Here are some specific complaints:

  • It’s too hard to tell different unit types apart. I’m playing on a very bright and razor-sharp LCD monitor, and I still have trouble distinguishing workers from spearmen from swordsmen. Distinguishing one civilization’s units from another’s is almost impossible without the “team color disc” option turned on. The problem is clearly not with the equipment I’m using, or with my eyesight; it’s the sloppy graphics.
  • Civilization borders are now shown with dotted lines. This is necessary, because civ borders no longer correspond to city radii and crossing a border can have serious consequences. Unfortunately, the dotted lines are often hard to see, and in some cases they’re just plain missing.
  • There are only two soom levels, neither of which I really like. Similarly, the game doesn’t seem to be able to use monitor resolutions above 1024×768, which is ridiculous in this day and age. I’d really like more zooming options, better use of the display area, and maybe a “flat” map mode.

Documentation and Game Mechanics
There are definitely some glaring omissions here. For example, you can’t get information about unit capabilities or city-improvement effects while you’re actually in the city management window. Instead, you have to pop out to the map window, look stuff up in the Civilopedia there, and then go back into city management. An even worse screw-up involves embassies. The manual says that to open an embassy you need to double-click the “Foreign Ministry” icon after you’ve discovered Writing. The what? It turns out that the icon in question is a little unlabeled star next to the city’s name on the map window. Who knew? Both my wife and I got stuck on this one for several minutes each. Figuring out how to do unit upgrades took a little while too, and I still haven’t figured out how to do conscription. Many unit commands are only available via keyboard shortcuts, which are too numerous to remember. A menu for all possible orders would be nice.

Game Play and Bugs
Staying on top of economic and morale issues seems much more difficult than in Civ2, though perhaps that’s just because I’m rusty and/or haven’t made all of the necessary adjustments yet. Culture and trade seem much more important. Some examples:

  • In one practice game, I suddenly “lost all of my cultural influence” and it was a total disaster – all of my cities in disorder, etc. I still don’t know why it happened, either, though I suspect the French (with whom I was at war) had something to do with it. I haven’t really played with the diplomacy/espionage features much yet, but I have the feeling I should.
  • In my current game, I’ve had three enemy cities – one quite large – defect to my side after being overwhelmed by my cultural influence. This seems like a very powerful (or dangerous) strategy.
  • Also in my current game, I established some luxury trade with another civ, and several of my cities immediately went into “We Love the King Day”. This dramatic response to trade also seems very powerful.

A lot has changed with respect to when things happen technologically. For example, monarchy is delayed by a couple of hundred years compared to Civ2, galleys (which are more like the old triremes) and pikemen by several hundred years, and aqueducts by a thousand. At first I thought it might just be that I wasn’t managing my research well enough, but the other civs don’t seem to be doing much better. I guess I just need to reevaluate the order in which I do stuff.

Game-balance issues are the same as ever. The enemy civs are still impossibly demanding in diplomatic negotiations, even at the easiest level. It seems like offering them anything less than 2:1 value just pisses them off, and I’ve never seen an attitude better than “polite” no matter what I give them. Similarly, they get all pissy if you set one foot inside your territory, even as they tromp all over yours all the time. I’m not sure yet whether it hurts you more to keep an eye out and confront them about it (might annoy them) or just let it slide (might make you appear weak to others). It has always bothered me how the game gives the computer players such huge internal advantages instead of coming up with a decent AI, and that obviously hasn’t changed.

I still love the game. How could I not? It’s still the ultimate “god game”. Nonetheless, I still wonder whether it’s as much of an improvement over Civ2 as Civ2 was over the original, and there are some areas that definitely still need work. Maybe there’ll be a patch soon, to address some of the worst oversights.