Archive for December, 2004

Six Reasons I Will Never Read The Da Vinci Code

In no particular order. I’m sure I could think of more than six, but it’s a round number.

  1. People seem to get worked up about it. Some tend to be ambiguous, trying to take credit for the ideas contained within it in an attempt to sound intelligent or informed.
  2. It has sparked TV specials endlessly advertised during the only network programming I have watched in the last five years, namely, football and baseball.
  3. My doctor advised me against participating in crazes. Also: fads, manias, fevers, trends, and rages.
  4. From what I have heard, all of the fawning over the Golden Ratio, numerology, and other pseudoscientific language would probably get me very annoyed.
  5. If you walk onto a subway car and more than two people on the same car are reading a book, it is virtually guaranteed that they are “reading TV.” Life is too short to read crap.
  6. I haven’t made it to the “religion” thing yet, I still haven’t gotten over the digital watches.

Please leave me a note if you believe me to be mistaken.

FxCop and Guidelines

Brad Abram’s Designing Good Libraries post inspired me to find out if some of the trickier rules mentioned are already caught by FxCop. Obviously many of the casing and naming guidelines are covered.

This code:

private static string[] _privArray = { "a", "b", "c" };

/// <summary>
/// We should not return the static array here,
/// as the elements can be changed by the caller.
/// </summary>
public string[] GetStrings()
{
    return _privArray;
}

Is not caught, but this code:

/// <summary>
/// We should not expose a static array like this,
/// because the elements can be changed.
/// </summary>
public static readonly char[] InvalidPathChars = { '\"', '<', '>' };

Is found with this message:

Either replace TheClassFromHell.InvalidPathChars with a strongly typed collection that cannot be changed, or replace the public field with a method that returns a clone of a private array.

It seems like it would be pretty easy to adapt that rule to cover the getter method example. Perhaps I’ll add that to my Festivus-vacation to-do list.

This code isn’t caught either, but it seems like it would be more difficult to find.

/// <summary>
/// The function should return an empty array instead
/// of a null array.
/// </summary>
public string[] GetStringsNull(bool a)
{
    if (a)
    {
        return new string[] { "a", "b" };
    }
    return null;
}

Man, I love FxCop. Partially because of moments like this:

Correct the spelling of the unrecognized token 'Sucky' in namespace 'SuckyLibrary'.

But mostly because it is more efficient and less stressful than reiterating standards ad nauseum.

On the same topic, I was wondering about this:

Using Structs

  • What happens?

    MyStruct[] arr = new MyStruct[10];

  • The constructor for MyStruct is not run here
  • Do not provide a default constructor

It seems to me as if it’s not possible to create a default (parameterless) public constructor for a struct – at least not in C# anyway. Maybe this restriction is not part of the CLR, or maybe we’re talking about constructors with parameters?

ESPN’s Sunday Night Football crew makes me want to club a baby harp seal to death.

Mike “Not getting back onto a network broadcast this century” Patrick just said, and I quote, “We have got a case of the giggles.” I prefer that my bizarre TV ticklefights involve Terry Bradshaw whenever possible, thank you.

Paul Maguire appears to have stopped bothering to groom his mustache sometime in the mid-70s. This walking soup strainer is usually good for at least nine inane and unnecessary slowmo replays per game, all ending in the word “BAM!!!!” Like John Madden, but dumber and not lovable. Tremendous insight is almost certainly locked away in the parts of his brain not yet invaded by his out-of-control ear hair.

Joe Theismann is plagued by a clinical inability to be critical of even the most despicable of players and personnel. His incessant and bizarre asskissing of Kordell Stewart, Chad Scott, Ray Lewis, aging Deion Sanders, Brian Billick, Mike Martz, and many others over the years was what originally prodded me to start watching this broadcast on mute years ago.

Suzy Kolber is the only bright spot, if that can be said about anyone stuck in the sideline role. I liked her hosting the countdown, the one night they had her subbing for Stewart Scott. If there is justice in the world, she will escape the horrible talent black hole that is the 8:00 ESPN game.

What others are saying:

ESPN’s Sunday Night Football Crew Worse than ‘Gigli’

Maybe [the people watching this broadcast are] perfect for the rah-rah hyperbole and endless Ray Lewis ass-kissing.

No, we’re not the NFL’s unquestioning cheerleaders. We’re just hardcore fans with apparently, enough of a penchant for sadomasochism to want to watch this piece of crap. I like the jab at Ray Lewis though. I still want to know where that dangerous bastard was when Joey Porter was shot. Good points overall.

ESPN Sunday Night Football announcers: you’re idiots

In the course of a game, [Patrick’s] primary goal is not to describe the action on the field, but to tout the exploits of key, hype-able players.

This sadly seems to be the case. I don’t have proof of a massive hype conspiracy, but I HAVE lost count of how many times the vastly overrated Ray Lewis has been “miked up” (or whatever the hell they’re calling it these days). He’s never produced a single worthwhile sound bite. I take solace in the hope that the electronic equipment is somehow making him sterile.

Did I mention I can’t stand Ray Lewis? I can’t stand Ray Lewis.

Losing God in the Fallacies

I was recently given the book Finding God in the Questions: A Personal Journey by Dr. Timothy Johnson in a failed bid to help me rediscover my religion. Let me start by saying that this is not normally the kind of book I would bother reading. It is banal, predictable, and as I will explain, largely fallacious.

However, having basically read it on a bet, I feel compelled to respond to it.

First, some background. You may be familiar with Timothy Johnson from various ABC News programs – he is the medical editor for that network. Aside from reporting on the Columbia prayer study that turned out to be a fraud1, most of his spots that I have seen personally have been reasonably informed.

Timothy Johnson

As he explains in the first chapter, Johnson has longstanding personal ties with the Christian faith2. Much to his credit, he certainly could not be described as a Robertson or Falwell fundamentalist. He is by no means a young-earth creationist. He does not seem to reject evolution outright, as one might hope from a physician.

Johnson is, however, is an Intelligent Design apologist. In the end, Mr. Johnson's evidence is imagined or nonexistent and he draws the conclusions that he wants to draw.

Johnson's book begins by talking about the scientific case, as he sees it, for the existence of God. The remaining sections are concerned with Christianity in particular. It is in the first section that I see the most reason for quarreling. I am simply too far from statements such as this:

…I personally believe that the otherwise unexplainable success of the early Jesus movement verifies the reality of the resurrection; in other words, I believe it really happened3

to bother replying. I would never finish this article were I to spend time on the definition of "otherwise unexplainable" and why this assertion is false.

And in truth, Johnson is a very moderate Christian in many respects. It doesn't make much sense to criticize his respect for the "historical Jesus" (whatever that is) when there are so many fire and brimstone types available.

Hindsight 20/20

Reading this book, I found I the following quote from Feynman constantly making its way to the front of my brain.

I had the most remarkable experience this evening. While coming in here I saw license plate ANZ 912. Calculate for me, please, the odds that of all the license plates in the state of Washington I should happen to see ANZ 9124.

It would not be accurate to say that his entire argument rests on instilling a sense of wonderment in the reader by reflecting on the enormous improbability of events that have already transpired. However, to a great degree this is the case. (The title of this section is, of course, a bad play on his worldview and the popular news magazine that he frequents).

The first truly jaw dropping work specious reasoning I found was in the second chapter, where he basically constructs the following syllogism.

  1. An idea frequently used to convey the law of big numbers is the "thousand monkeys banging on a thousand typewriters for a thousand years" analogy.
  2. In truth, given a thousand years a thousand monkeys would probably still not produce the combined works of Shakespeare.
  3. Therefore, given an infinite length of time, an event such as a universe with complex life is similarly unfathomable.

He goes so far as to say,

For me, the most dramatic analogy of the improbability of chance alone accounting for life as we know it comes from the same Fred Hoyle who coined the term "big bang": "The chance that higher life forms might have emerged in this way is comparable with the chance that 'a tornado sweeping through a junk-yard might assemble a Boeing 747 from the material therein.'"5

It is worth pointing out a minor problem here, in that Hoyle unwittingly coined the term "big bang" in an effort to decry the idea6. Hoyle was one of the last proponents of steady-state cosmology, an idea that the universe is described by one of a few infinite-duration models.

In making this argument, Johnson displays an appallingly unsophisticated understanding of probability. Use whichever terminology you like – "infinite length of time," "infinite number of trials," whatever you want. When infinity is involved, all events with nonzero probability are absolutely certain to occur!

We are of course both making the implicit assumption that "probability" has any meaning outside of our universe, and perhaps also the assumption that "outside our universe" holds any meaning. I will spare everyone the headache of getting involved in this discussion.

God of the Gaps

Johnson makes quite a big deal out of the fact that living organisms have arisen from nonliving materials. He makes sure to point out that Darwin didn't know how this might have occurred7, as if Darwin wrote the unalterable gospel of scientific thought on the subject.

In asserting that because Darwin could not explain this process in the mid-nineteenth century, that a description shall ever be "unfathomable," Johnson has effectively retreated into a "god of the gaps" argument.

Even if we cannot yet adequately model something, we are not justified in saying that it is therefore an unlikely event. Complex adaptive systems developing when sufficient chemistry is available may in fact be highly likely. He is drawing a fallacious connection between (perceived) complexity and probability.

Cosmic Coinkee-dinks

Dr. Johnson is quite taken by what he terms "cosmic coincidences," one of which is apparently the fact that Earth orbits the sun without being flung into interstellar space.

…if the planets formed were too close to each other, they could destabilize orbits. The distance between planets in our solar system is about 30 million miles, just the right distance for stable orbits7.

Let's take a closer look at that second sentence, as it certainly set off several alarm bells in my head and I hope it did the same in yours. Here are the actual figures for the distances between the commonly-accepted nine planets. The first numerical column is the distance between each planet and the sun in astronomical units. The second is the same measure in millions of miles, and the last is distance from the previous orbit8.

Planet AU Millions of Miles Difference
Mercury 0.38 35 -
Venus 0.72 67 32
Earth 1.0 93 26
Mars 1.5 140 47
Jupiter 5.2 480 340
Saturn 9.5 880 400
Uranus 19 1800 920
Neptune 30 2800 1000
Pluto 40 3700 900

This is of course a simplification, as the actual orbits are not circular. The average is an order of magnitude from the stated 30 million miles, and where they got the idea that this is the "right distance for stable orbits" is beyond me. Frankly I am not interested enough in this drivel to bother finding out.

Dr. Johnson cites a book called Nature's Destiny by Michael Denton as the source of this unbelievable, outrageous error. I circled this citation in my copy of the book, planning on making a note of how much he relied on this source. He made the job pretty easy for me.

For this section I am relying heavily on a book titled Nature's Destiny by Michael J. Denton, a senior research fellow in human molecular genetics at the Universe of Otago in New Zealand9.

Michael J. Denton and his ideas are beyond the scope of this paper, but suffice it to say that he is huge in creationist circles but not highly regarded in the scientific community. Some critiques of his work can be found here and here.

Moving on, Johnson marvels at the fact that life has evolved into forms that are physically possible. As opposed to, I guess, forms that would have no chance of surviving in our corner of the universe.

…the majority of the electromagnetic radiation produced by the sun is… [in the] range needed to provide the energy for the great majority of chemical reactions that occur in living creatures. And here is the real kicker: the electromagnetic radiation in the other wavelengths is very dangerous to human life10.

So successful living things use energy sources that are abundant, as opposed to sources they'd have trouble locating. And humans live in an area of the universe where they would not instantly fall over and die. This is fascinating, groundbreaking stuff. Really it is.

I'm still trying to get this straight—and if you'll bear with me here I think it might help if I try to write out his syllogism once again.

  1. The universe contains water, light, oxygen, and carbon.
  2. The universe also contains life forms that have developed to take advantage of these resources in various ways.
  3. Therefore the universe was expressly designed for the purpose of developing those forms of life.

Now I see. Well, I'm convinced. Sign me up.

I expected that his argument would be more sophisticated, but it really is not. He of course mentions the apparently "fine-tuned" physical constants, but shows no sign of comprehending the possibility that they are artifacts of our incomplete physical models. The Standard Model does not include their derivations, so according to him no derivations must exist. They must be divinely fixed. More god of the gaps.

Jumping to Conclusions

I don't know how serious Dr. Johnson really was about authoring a scientific argument for a god. Indeed, there is another half to this book concerned mostly with Jesus and the gospels, and there is frequent discussion of his own doubts and beliefs.

Presumably, if he were serious about the scientific questions, he would read and cite more sources that are hostile to the Intelligent Design apologists. He seems to only be interested in supporting his preconceptions.

This book is more about Dr. Johnson convincing himself than it is about Dr. Johnson convincing anyone else. In this effort, I am sure that he has succeeded admirably.

  1. Flamm, Bruce. The Columbia University 'Miracle' Study: Flawed and Fraud Skeptical Enquirer Magazine, September 2004; reprinted on CSICOP website.
  2. Johnson, Timothy. Finding God in the Questions: A Personal Journey. InterVarsity Press, 2004; pp. 17-18.
  3. Johnson, p. 130.
  4. Feynman, Richard. This Unscientific Age. 1963.
  5. Johnson, p. 38.
  6. Various. Fred Hoyle. From Wikipedia.
  7. Johnson, p. 44.
  8. AU figures are from Wikipedia. Calculations mine.
  9. Johnson, p. 46.
  10. Johnson, p. 48.

Fear and Loathing in Middle America

Briefly, between Pittsburgh International and my house, my mother was listening to the Oliver North radio show. A breathless woman called in to share this nugget with the world:

We were watching [National Lampoon's Christmas Vacation] last night, and at the point where the old woman is supposed to say grace but says the pledge of allegiance instead, they BLEEPED OUT GOD.

Clearly a paranoid delusion or a hoax, but it is beyond my powers of deduction to figure out which it is. I must say that if I wanted to start an urban legend and watch with glee as it spread, I would try to word it about like that.

So we switched the channel to NPR for a while, and they had a (lengthy) story about the patriotic country song being promoted under false pretenses by an artist’s fan club. I’d heard of this before, but I hadn’t paid much attention. The NPR piece, however, included a clip of the song including these lyrics:

Cause I’ve been to Hiroshima

And I’ve been to the DMZ

“Did I just hear that?” I asked my mother. “Yes, you did,” she replied.

I must say the drive was not a totally negative experience. There is nowhere else in the world with vandals that you would actually call “almost helpful.” Someone spraypainted this graffiti over a roadsign near my house:

DANGER DEERE CROSSING

Visual Basic Case Insensitivity

Here’s something that bit us today. Somehow, our big solution has been tricked into thinking that the System.Web.UI.Control.DataBind method is actually Databind (with a small “b”). It became impossible to type “DataBind” in Visual Studio without VB autocorrecting to “Databind.”

Most of the time, this didn’t matter an awful lot. However, when you do the following, you discover another one of those situations where VB helps you create behavior that is totally incomprehensible to and unfixable by your average VB programmer.

Public Class SomeCtrl
    Inherits Control

    Public Overrides Sub Databind()
        ' do something fancy
    End Sub
End Class

' ...

Public Sub Test()
    Dim C As Control = New SomeCtrl
    C.DataBind()
End Sub

For us, that C.DataBind was calling the DataBind method in System.Web.UI.Control! The reason can be found in Reflector:

VB.NET compilation bug

Visual Basic was actually creating a NEW virtual method with the lowercase b. It was NOT overriding DataBind. Despite the overrides keyword, which I guess is just a compiler feature and not a CLR construct (the virtual in MSIL covers everything).

We fixed our issue by opening up scores of .vb files in emacs, updating them to have the uppercase B, and then by deleting all of the files in %systemroot%\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\ on all of our dev machines and our build machine.

Is this yet another artifact of an extremely large VB solution? I have no idea, but to me, compiler bugs are very scary.

Reason one, insanity two billion

It is unbelievably refreshing to see a Reuter’s story such as this one about James Randi on the Yahoo front page. There’s not even a lame and fallacious rebuttal by Gary Schwartz to be found in it.

A Hypothetical Interview with D. Oscar McKinley

EW: What do you think is the biggest problem facing America today?

OM: Well Mitch, I don’t think nearly enough people are complaining about the nonexistent trend towards secularism. When that happens, I really start to worry. I don’t worry about the trend, of course, but rather the trend of people worrying about the trend.

EW: What’s a hep cat like you do for fun on the weekends?

OM: Mostly I think about the weirdness of existence itself, when you get right down to it. The ineffability of everything and grave implications of Gödel’s theorem. I’m also heavily into the Pittsburgh Steelers, the occasional psychotic episode, and an indie rock band called Spoon.

EW: What is your opinion of the most recent (U.S.) presidential election?

OM: Well like most levelheaded people, I get 90% of my news and opinions from various forwarded emails. So far they are undecided on the issue.

EW: In that case, do you think there is reason for hope? If so why so, and if not why not?

OM: That entirely depends on what you are hoping for. If you are hoping that the human race will not go extinct one day and the universe won’t end one way or the other, I’d like to point out that you’re a goddamn fool, Chester. If you are hoping that you can get a good corned beef sandwich for lunch today, the odds are stacked in your favor.

EW: It sounds to us like you’re avoiding the question.

OM: Poorly-phrased questions deserve vague and indirect answers.

EW: You seem to use the word “entropy” a lot. What the hell is that about?

OM: The way I like to think about it is as follows. Right now there are scores IF NOT hundreds of beer bottles on my computer desk. No matter how many of those I transport to the garbage can in the kitchen, throw out the window in disgust, or comically hide in my roommate’s pillowcase, there always seem to be more next time I come back. That’s what I’m talking about, in a nutshell.

EW: What is the most irrational thing you do regularly? Be honest, please, you’re among friends.

OM: I check the AIM info for dozens of people I have not spoken to in years, and have zero percent chance of speaking to ever again.

EW: What’s something that you find extremely funny?

OM: The names of legal cases. For the life of me I can’t say “Higgins v. Belsky” or “Bilquist v. Stewart” with a straight face. It’s cost me a $300,000 salary and three more years in college, frankly.

EW: You’ve thought about being a lawyer, then?

OM: Well only for spiteful reasons. I don’t have any independent interest in the law.

EW: Who are you deep down, Oscar McKinley?

OM: One part Gary Busey, one part Nick Nolte, one part floor sweepings.

EW: Is P the same as NP?

OM: Come up with a good corned beef sandwich and I’ll tell you.

EW: You’ve been an outspoken critic of the media. What the heck is your problem?

OM: I think the problem can be summarized by the fact that there are three news stories that you can COUNT [ed: Mr. McKinley shouted this word and wagged his finger toward the ceiling violently] on coming out at least once a year. The first is that unnamed scientists somewhere in Russia have discovered conclusive proof of ESP. The second is that there is an uncontrollable butter fire in Minnesota. And finally, the third is that some idiot called the police because his marijuana stash was stolen.

EW: What advice would you give to any budding eccentrics out there?

OM: I would advise you to develop a healthy, obsessive fear of boiling in Hell at an extremely young and formative age. Go through periods where you will only respond to questions in German and refuse to read any authors who have lived in the past 1,000 years for no apparent reason. Fall asleep in stairwells in absurdly public places. And of course, DON’T EVER GIVE UP!!

EW: Oscar old buddy, thank you for taking the time to talk to us.

OM: The pleasure was all mine, Steve.