FIFA Rankings

FIFA has released their world ranking for September, and I’m puzzled. These rankings look even stranger than the BCS college football rankings. The United States is consistently ranked in the top 10, yet I don’t think anyone actually sees them as a lock for the quarterfinal of next year’s World Cup, which is how I’d interpret being ranked 7th. Certainly no one would expect the United States to beat England (who are ranked 11th) just now. And as you look closer, the results get stranger.

According to FIFA’s article, the ranking “is heavily shaped by the 89 FIFA World Cup qualifiers and nearly 40 friendly matches played last month.” Interesting then that Mexico, who was beaten soundly by the United States in one of those matches, maintained its 5th ranking, while the United States slid from 6th to 7th. And in beating Mexico, the United States qualified first from the CONCACAF region for the World Cup, ahead of Mexico, who, by the way, haven’t beaten the United States outside of Mexico City in close to a decade. Why then is Mexico consistently ranked ahead of the United States?

My Favorite Meals

There are four meals to be had in New York of which I cannot get enough, of which I can’t stop thinking once the thought of them has first occurred to me. They are (in no particular order):

I claim no sophisticated culinary superiority for any of them, and I wouldn’t be surprised to learn that better versions of each could be found elsewhere (especially of the fish and chips, which are hardly native to New York), but they’re my favorites here in New York, and I recommend trying them should you get the opportunity. What are your favorites where you live?

I’m Morgan and I’ll Be Your Moderator

I got my first comment here today (thanks Karen), and discovered that, in order to control comment spam, I have to approve comments as they’re posted. I had no idea. So if you post a comment and it doesn’t show up right away, please be patient. I’ll approve it as soon as I become aware of it and can remember my password.

Alexi Lalas’s Challenge

Gothamist has an interview today with Alexi Lalas, the President and General Manager of the New York MetroStars (to whom Eric and I hold season tickets). He certainly seems to understand the challenge he faces:

It’s hard enough to get people to come out and watch soccer, we don’t want the additional burden of having a mediocre team.

My question is, in a league with nearly absolute parity as both an intention and a result, how does he expect the MetroStars to stand out? And how will that affect soccer in other markets at whose teams’ expense the MetroStars will be constantly winning?

Rebecca Turner’s Land of My Baby

Ah, to be in and only in the presentThat state and what’s experienced through it is Buddhist enlightenment, stripped of all explications and elaborations. I’ve had instances in my meditation practice that have indicated this, but the most reliable means to this experience for me so far is music.

The live interplay of musicians, preferably of stringed instruments (guitars, bass, maybe a mandolin or a lap steel) and some drums, can lead to a moment outside of time–an instance of time not as container, but as medium. I seek this wherever I can find it. I like to imagine that there are as yet unknown recordings of the album with which the Rolling Stones were supposed to follow Exile on Main St., or of Keith Richards, Mick Taylor, and Charlies Watts playing with R.E.M. during the making of Out of Time, or of Gram Parsons, back from the dead, working with Lucinda Williams on Car Wheels on a Gravel Road, all of which I’ll find at a tag sale someday, take home, and revel in until I’m entirely open to the present. But until I discover that terma, I take the momentos de la felicidad where I can find them.

Last Wednesday, we went to the release party for Rebecca Turner‘s new album, Land of My Baby. My wife and I have known Rebecca for years, but her evolving musical accomplishment keeps surprising me. Seeing her with just her guitar at a little bar for the first time years ago, I was astonished to hear a fully formed artistic voice emerge so convincingly from someone I knew. Then, years later, hearing that voice fleshed out by a band on her CD, I was astonished anew. Yet neither of those experiences, much as they should have, prepared me for hearing her play live with that full band. The Slipper Room, where we saw them, is a great room with great sound. The band was fantastic–looser and more muscular than the album, while sacrificing none of its focus. And there were moments when I was pulled by the intertwining rhythms and vibrations fully into the present. And as the Buddhists do, I bow to the experience.

Writing Maintainable Code, Episode 1

Context:

This is in a medium-sized EJB-based application that uses bean managed persistence. An interface is defined to perform a set of searches of a certain type, with different implementing classes being used at runtime depending on what’s being searched for and what criteria are being used. Among the interface’s methods is one the returns a SQL sub-query based on a given collection of values. One implementation of that method is discussed here. The developer was awaiting help from the database group and never got back to this method to implement it. That didn’t cause any trouble at initial deployment, because this particular implementation wasn’t used by any of the code that could be called from the application’s client, though given that the decision as to what implementation will be used is made at runtime, that’s not apparent from the code.

Wrong:

    public String composeSqlStatement(Collection ruleValues) {
        //:TODO:
        //Talk to the DBAs and get help...
        return null;
    }

Result:

A few years after initial deployment, this application was to be significantly revised to reflect substantial changes in the business it supported, and the revision was to be done by an entirely new team of developers. In seeking to test new functionality, one of the developers wrote a unit test that, through the search interface, called the method above. However, since that method was only returning a piece of a larger SQL statement, the method calling it didn’t throw the NullPointerException that you’d expect with a method that’s meant to return a value returns null instead. When the resulting SQL statement was finally executed by another method elsewhere in the application code, an exception was thrown indicating that the SQL statement was invalid. Given that the SQL statement was more than a dozen lines long, it took some time to determine that the null, which appeared in the statement as an ordinary string (with a value of “null”), was causing the problem. And given that it was being called through an interface with more than a dozen implementing classes, it took more time to determine which method was returning the null. In all, it took more than one full day of developer time to resolve this.

Better:

    public String composeSqlStatement(Collection ruleValues) {
        //:TODO:
        //Talk to the DBAs and get help...
        throw new UnsupportedOperationException("composeSqlStatement()  " +
            "method not implemented in class TypeASearchDAO");
    }

Had the initial developer written the method to throw an exception if it was ever called, the problem would have been discovered the first time the method was called by the unit test. The cause of the problem and the appropriate solution would have been immediately apparent.

Writing Maintainable Code, An Ongoing Series

Much of the software development that I do is the maintenance of existing code (as opposed to writing new applications from scratch). Having done this for a number of years now, I’ve begun to see things that can be done during initial development to make code easier for subsequent developers to maintain years later (or more precisely, I’ve seen all of the things that are done to make code more difficult to maintain). Usually these techniques come down to following the coding techniques described in any good computer science text (careful design, proper encapsulation, following valid naming conventions, adequately commenting code, etc.).

It seems that most developers who write new applications tend not to end up maintaining code, so they tend not to see first hand the consequences of decisions made in the name of expediency. I don’t mean to say that they’re necessarily being sloppy or lazy. The code I’m talking about works fine at deployment–the results of these decisions aren’t bugs. But they can make subsequent maintenance more difficult and error-prone. So for such developers, I offer this ongoing irregular series of examples of why–even though it doesn’t make a difference in the current functioning of your application–you should make the extra effort to follow good design and coding techniques. I’m also hoping to document my experiences as background to inform the design and development discussions I participate in. In those discussion, I often find myself arguing against hacks that seem harmless, but that I suspect will cause problems later. I hope that with enough examples, I’ll be in a better position to make my case clearly and convincingly.

Freud Freed

I’ve been reading Freud again recently (“Mass Psychology and Analysis of the ‘I”” and “The Future of an Illusion” in Mass Psychology from the Penguin series of new translations), and I’ve been thinking of Plato’s “Allegory of the Cave.” The allegory goes something like this:

Imagine prisoners who have been chained since childhood deep inside a cave. Not only are their limbs immobilized by the chains, their heads are as well so that their eyes are fixed on a wall. Behind the prisoners is an enormous fire, and between the fire and the prisoners there is a raised way, along which men carry shapes of various animals, plants, and other things. The shapes cast shadows on the wall, which occupy the prisoners’ attention. Also, when one of the shape-carriers speaks, an echo against the wall causes the prisoners to believe that the words come from the shadows. The prisoners engage in what appears to us to be a game—naming the shapes as they come by. This, however, is the only reality that they know, even though they are seeing merely shadows of images.

Suppose a prisoner is released and compelled to stand up and turn around. His eyes will be blinded by the firelight, and the shapes passing will appear less real than their shadows. Similarly, if he is dragged up out of the cave into the sunlight, his eyes will be so blinded that he will not be able to see anything. At first, he will be able to see darker shapes such as shadows, and only later brighter and brighter objects. The last object he would be able to see is the sun, which, in time, he would learn to see as that object which provides the seasons and the courses of the year, presides over all things in the visible region, and is in some way the cause of all these things that he has seen…

Once thus enlightened, so to speak, the freed prisoner would no doubt want to return to the cave to free “his fellow bondsmen”. The problem however is that they would not want to be freed: descending back into the cave would require that the freed prisoner’s eyes adjust again, and for a time, he would be inferior at the ludicrous process of identifying shapes on the wall. This would make his fellow prisoners murderous toward anyone who attempted to free them.

It occurs to me that, having gained his release through his own self analysis, Freud’s compromise in the face of this paradox was to not turn around and leave the cave. Indeed, in his published writings, he doesn’t seem to have concerned himself with what’s beyond the shadows on the wall (though Freud’s Requiem, a marvelous little book published last month, uses his letters and other secondary material to suggest that he did consider such matters outside of his published works). Instead, he sought to discover the workings of the shadows on the wall using only what could be seen and understood by the prisoners in the cave. Such efforts must inevitably point beyond the cave, but Freud resolutely refused to follow where his reasoning led.

On the one hand, this meant that Freud’s work could be used by his “fellow bondsmen,” but on the other hand, that work feels incomplete. In this sense, Freud’s work is a critique, describing only what’s wrong with the commonly held view of reality. It doesn’t really propose a fuller, more compelling view as an alternative. Consequently, Freud’s claims that things don’t work as most people think they do will always be susceptible to counterclaims that he doesn’t offer an explanation of how they do work.

Most sages, having gained their release from the chains of common delusion, have tended to venture beyond the cave, and those who have returned, have announced their return in one of two ways. Some have returned with wild-eyed and incoherent tales, as predicted in Plato’s allegory. I tend not to trust their understanding and insight. But others, from the Buddha to Wittgenstein (including Plato’s Socrates) have returned to say that there are more things in heaven and earth than are dreamt of in our philosophy and that though those things can’t be described, the sages can tell us how to find them for ourselves. I’m more likely to trust their insight and experiences.