Obama Won. Now What?

I may not be unique in the following regard, but I’m not as excited about Obama winning tonight as I was the first time. I guess that’s not a surprise; a certain amount of disillusionment would be expected to follow national during the previous presidential election. As Obama explained to his campaign staff, “we’re not as cool as we were four years ago”. But why? While the answer seems clear to me, I don’t think Obama quite gets it. So, to start his second term as president, let me humbly make some suggestions. First, let us remember that Obama won a mandate in 2008. He even got a majority in both houses of Congress, albeit with many conservative “Democrats” in the House. Still, there’s no denying that Obama was swept into office on a wave of enthusiasm.

What happened to that wave? Why were people so much more excited four years ago? Novelty only goes so far in explaining this. While it was exciting that he was the first non-white male president this country has ever had, I don’t think it explains much of the decline in his supporters’ enthusiasm. Another reason may be that his speeches have lost their luster. Again, while this is certainly part of the answer, I believe there are bigger reasons, which deserve more credit and attention.

What these explanations tend to ignore is the actual substance of Obama’s convictions, convictions that resonated with and are common to broad swaths of the America, including me. Those beliefs are expressed very nicely in his book, The Audacity of Hope, and perhaps to a lesser extent, in his memoir, Dreams from my Father. He doesn’t merely list where he stands on the issues of the present era. Instead, he provides a broad personal narrative that gives force to his convictions, and compels readers, perhaps not to the point of changing their point of view, but at least to the extent that it is not difficult to see why he believes what he does. Such convictions are not so easily wiped away.

What made these books so popular is that they eloquently put into words what so many of us already believe, although most of us do not possess comparable gifts with which to express those beliefs. I say that those beliefs are widely shared, because they are rooted in common traditions, values, and experiences that transcend all the typical demographic characteristics. They are a big part of what binds us together as one country, despite our differences.

Somewhere along the way, those values got lost in Obama’s elusive search for bipartisan cooperation. Don’t get me wrong: it would be great if the two parties found a way to work together, learn to compromise, and get along in a more collegial manner. Unfortunately, it takes two to tango. This is the key stumbling block that Obama has run into so many times in his first term. He has paid for this not only in terms the amount of change that he was able to effect, but also in terms of his perceived David-like “scrappiness” in facing down Goliath Republicans. With the quickness and regularity with which he caved to the opposition, I couldn’t help but wonder, as I believe many of his supporters did, “What happened to the idealism that we saw during the campaign? Where is the president that I voted for?“.

I found myself asking this question many times during the past four years. At first, I thought that Obama just needed more experience in negotiation. I still had high hopes that he would quickly learn that concessions would not be taken as a sign of good faith, which would serve as a basis for earnest compromise, but rather as a sign of weakness, to be exploited to gain further concessions. As far as I can tell, the latter is the view taken by opponents and supporters alike. Eventually, my hope gave way to dispair as Obama seemed determined to do politics the “amicable” way despite operating in an openly hostile environment. Again, I hope the lesson that it takes two to tango filters through to Obama as soon as possible. I believe this is the point where Obama enthusiasm started its long decline.

Allow me to reiterate this point: Obama won his first election with a mandate. Not only did he capture a large fraction of the votes, Democrats won both houses of Congress. Four years later, that mandate has been erased, squandered. Obama would probably say that this happened mostly because the country is fundamentally right of center. Despite all his talk about hope and optimism, this attitude strikes me as extremely pessimistic. The premise seems to be that people’s beliefs are immovable, to be navigated, rather than maleable, to be pushed in a positive direction. Besides, if America really is slightly that conservative, how did Obama win a mandate with his clearly liberal positions as described in his campaign and books? Allow me to put forth a “bold” explanation: the people voted for Obama, because they wanted what he was selling. You see, they turned away not because he turned out to be brashly liberal, but rather because they lost faith in his willingness as president to advocate for changes that he as presidential candidate had advocated for.

The way I see it, Obama faces three fundamental problems:

  1. politics: How can Obama get more of what he wants?
  2. electoral disillusionment
  3. Washington’s toxic atmosphere

In focusing so much on 3, he has sacrificed 1 and 2. As a result, he did not achieve as much as he should have in any of these areas. Therefore, he should get back to his roots, the beliefs that so many of us share and hoped he will fight for. This might mean raising some GOP hackles,  but guess what? They were already out to get him from the get-go. It is futile to avoid this. Instead, he should marginalize the radical conservative elements. In this, he may be able to count on the support of moderate conservatives.

What I believe he can expect from this change in tac is a more satisfied, more supportive electorate, and more favorable (for liberals) political victories. With any luck, he will gain some respect from his political adversaries, who will realize that their shrill cries make them look weak, petty, and pathetic. There is much time to be made up for, but Obama has a fresh four years to work with. Let’s hope he spends them well.

Advertisements
Posted in Uncategorized | Leave a comment

Reviewing Code

When someone asks me to review their code, I take it as an opportunity to express my opinion about code, but I don’t expect to convince the other person. I used to approach code reviews differently though. I used to think that code reviews are about making sure nothing “bad” ever gets checked in. Of course, there is something to that idea, but it’s easy to take it too far. The problem is that different people have different ideas about what constitutes good vs. bad code. While such beliefs often have coherent justifications, they are often held with religious ferver. When such beliefs clash, a code review can quickly reach an en passe.

I’ve decided that such conflicts are usually unwarranted. It may be that one person’s way is actually better, and that time would bear it out. Unfortunately, we do not have the benefit of knowing what happens in the future. Therefore, the “but this will have lasting consequences” argument does help one side vs. the other. BTW, this fallacy comes up in many areas of life. The weight of a decision does not justify any solution more than any other. It merely argues that the decision not be made lightly, which is often something that all sides agree on anyway.

Such differences in opinion practically never work themselves out during code reviews. Beliefs about how to code something are the unique product of personal experience. Often, one isn’t even fully aware of the source of those beliefs (again, this applies to life in general). Even when one knows (or thinks one knows), it rarely helps move the code review along, because the other person also has a personal well of experience to draw from. And yet, the problem remains: What code is to be submitted? Since there is little chance of convincing the other person that another way is better, there is little value in having an extended argument about it.

My general strategy (whether I am giving vs. receiving a code review) is to marshall the most cogent argument that I can, and hope to convince the other person. After that, I just do whatever makes it easiest to submit code. This is a bit easier when I am giving the review, because when I receive a review, I feel a much greater sense of ownership. I do feel that deference should be given to authors, because dampening enthusiasm by crushing one’s sense of ownership hurts productivity, retention, etc. This is not to say that reviewers should allow authors to run amok. It just says that reviewers should insist only on egregious violations. Don’t sweat the small stuff!

Posted in Uncategorized | Leave a comment

Romney on Israel and Iran

This is a response to a comment posted to a nytimes.com article about Romney’s position on Israel, which he articulated during a visit to that country. I’ve posted this to my blog to avoid nytime’s character restriction.

Romney and Obama do not disagree about whether Israel has a right to defend itself. Where they differ is whether they would condone an Isreali attack on Iran.

David faces Goliath.The Isreali point of view that you describe can easily be turned around: The USA is currently the world’s only superpower. Our military spending exceeds that of the next 17 countries COMBINED (other sources say that number is even higher). Perhaps more to the point, we have thousands of nukes, while Iran (currently) has 0. Also unlike Iran, we have the capability to strike anywhere in the world with very little warning, thanks to the platform created by our fleet of ballistic missile submarines. At the same time, we have labeled Iran as part of an “axis of evil”. The message to Iran could not be clearer: if we had the chance, we’d wipe you off the earth. Sounds pretty threatening, doesn’t it?

Obviously, we need to do everything we can to stop Iran from developing nukes. That does not mean we should allow Israel free reign. As a responsible superpower, we should send Israel a clear message: an attack at this point would be out of proportion. The fact is that Iran is not on the cusp of acquiring nukes. According to our very own intelligence, Iran stopped trying to build a bomb in 2003. However, for the sake of argument, I will assume that Iran is secretly trying to develop a nuclear weapon.

Moreover, there’s a strong argument to be made that an attack would be counter-productive. One of the reasons that the Iranian has to internally justify a military nuclear program is the threat of an Israeli attack. If an attack were to actually happen, Israel would be giving political ammunition to Iran’s hard-liners who back a military nuclear program. At the same time, such an attack will not stop Iran’s nuclear program (this article quotes Admiral Mike Mullen, and is published by Israel’s oldest daily newspaper).

Conservative accuse liberals of abandoning Israel, particularly on Iran’s nuclear ambition. This is a lie. Conservative leaders should stop promulgating it, and followers should stop believing it. Americans across the political spectrum agree on the goal: stop Iran from acquiring nukes. Therefore, let us debate how to best achieve that, instead of distracting from the issue, accusing the other side of lacking commitment. Such ruses only help Iran to operate under the cover of US political confusion.

Posted in Uncategorized | Leave a comment

Cache-Conditional HTTP Requests

For whatever reason, HTTP’s cache-conditional headers confuse me. I think I’ve figured out how to keep them straight in my head though: the trick is to read “If-<Whatever>” as “Do the ‘normal’ thing if <Whatever> is satisfied”. In this context, the “normal” thing means what the server would have done had “If-<Whatever>” not been used. For example, “If-Modified-Since: <X>” in a GET request means “Send me the content if it has been modified since (i.e. after) <X>”.

I think what confused me was “What action should the server take if the condition is met?” The header names do not indicate what action to take; merely what condition must be met in order for some action to be performed. After several readings of the spec (RFC 2616), and some thought, I realized that the implicit action (in the event that the condition is met) is to do whatever the server would have done, had the cache-conditional headers not been present, which usually means just sending the content back to the requester.

Cache-conditionality is based on two values, known as validators: (most recent) modification time, and entity tags. These correspond to the “Last-Modified” and “ETag” response headers. Furthermore, cache-control headers may be positive or negative. Here is a table summarizing how we’ve just categorize cache-conditional headers:

Sense\Validator modification time entity tag
Positive If-Modified-Since If-Match
Negative If-Unmodified-Since If-None-Match

This gives a basic outline of the cache-conditional headers, but in order to really understand them, one must understand what they were designed for, and in what situations you’d generally use them.

Modification Time

The “If-Modified-Since” header is probably the easiest to understand, but what about “If-Unmodified-Since”? Why would a requester be interested in the content if it hasn’t changed? The basic instinct behind this questions is right: you would normally only be interested in content if it has been updated. This header is not for normal requests; it is for subrange requests. When we think about a typical request, subrange requests probably don’t come to mind. That’s why the use of this header probably isn’t obvious.

Let’s briefly turn our attention to subrange requests. When a requester makes a subrange request, he presumably already has a portion of the content, and he wants to fill in the rest, without having to download the entire thing. In order to do this, he needs to make sure that the content on the server hasn’t changed; otherwise, the requester will be stitching together pieces from two different versions. In general, the result of such a combination is not going to make sense.

CatdogWhat the requester needs is a way to tell the server, “I want a portion of a particular version of the content found at this address”. This is exactly where “If-Unmodified-Since” comes in. Using my technique for understanding cache-conditional headers that I described at the beginning, “If-Unmodified-Since: …” means “Send me the content if it hasn’t been modified after … (since that’s the version that I want to complete)”.

Entity Tags

“If-None-Match” is used in a similar way to “If-Modified-Since”: it is used to detect when changes have been made so that the server only needs to send the content when the requester’s cached copy is no longer valid. There are a couple of odd things about this header that you may have noticed:

  1. Unlike “If-Modified-Since”, this is a negative header. Don’t let that fool you; “If-None-Match” is still about detecting updates so that only updated content is sent back.
  2. As “None” suggests, many entity tags can be passed; whereas, “If-Modified-Since” is implicitly singular. The underlying reason for this difference is that (modification) time follows an ordering; whereas, entity tags do not.

Notice that in the typical case where only one “If-None-Match” entity tag is passed, the semantics can be stated as “Do the normal thing if the entity does not match…” which is probably less awkward sounding than the more general rendering “Do the normal thing if the entity does not match any of …”. If you prefer, you can think in terms of the former.

The opposite of “If-None-Match” has a simpler name, “If-Match”. Perhaps surprisingly, both headers are plural. A more analogous name would have been “If-Any-Match”. Naming aside, the use of “If-Match” may not be intuitive at first, as with the opposite of “If-Modified-Since”. This header can also be used to make subrange requests conditional, although the spec does not specifically discuss this use. Instead, it focuses on how this header is used in non-subrange requests:

  1. “The purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction overhead.” Imagine several caches along a request chain: a browser cache, and two shared network caches. Each of them has a stale cache entry, but each cache has a different version. All of the caches can discover whether their respective entries are still valid within the same request.
  2. “It is also used, on updating requests, to prevent inadvertent modification of the wrong version of a resource.” In other words, a requester can use this to make sure that it does not clobber changes that some other requester might have made.

Interactions

Now that we know about all the headers that make requests cache-conditional, let’s think about how they work together. What happens when you use more than one of these things at a time? In general, when multiple conditions are specified in a single request, all of the conditions must be met in order for the server to do the normal thing.

There are only two combinations that have defined behavior (the behavior of other combinations is not defined):

  • If-Modified-Since + If-None-Match: As noted above, both of these are for detecting when the content has changed.
  • If-Unmodified-Since + If-Match: Analogously, both of these headers are used to detect when the content has not changed.

For the sake of simplicity, we’ll say that the other combinations are not allowed, because their behavior is undefined. Technically, the specification does not forbid requesters from using those combinations, but servers are not required to behave in any particular way when they receive such requests.

Notice that you cannot combine different headers that use the same validator i.e. the following are not allowed:

  • “If-Modified-Since” + “If-Unmodified-Since”: When request says “If-Modified-Since: <X>” and “If-Unmodified-Since: <Y>”, and X >= Y, it would not be possible to satisfy both conditions. In the other case (i.e. X < Y), it is possible for both conditions to be met, but a cache would never store two versions with different modification times.
  • “If-Match” + “If-None-Match”: This case is similar. If the “If-Match” entity tag is in the set of “If-None-Match” entity tags, then it would be impossible to satisfy both conditions. Otherwise, “If-None-Match” is superfluous.

There are two more combinations that we have not mentioned; this gives us a total of 6 (4 choose 2) combinations:

  • If-Modified-Since + If-Match: Imagine what using these together would mean: what the requester would be telling the server is, “If the content has been modified, and it is this particular version, then do the normal thing.”. Well, if the requester already know the version of the content that it wants to target, specifying a modification time would be superfluous.
  • If-Unmodified-Since + If-None-Match: As with the previous point, this combination would be sending conflicting signals: on the one hand, the implicit requester expectation of “If-Unmodified-Since” is that the content hasn’t been modified; whereas, “If-None-Match” has the opposite implicit requester expectation.

The problem with these two combinations is not that they are logically incompatible; the problem is that the implicit intents behind the headers are opposed, which is a good sign that the requester is confused. This is why the specification allows the server to do whatever it wants when it encounters such combinations.

If-Range: The Oddball

The final cache-conditional header is “If-Range”. Unlike the headers we have talked about so far, it does not make a request conditional, even though it’s name begins with “If-“. Instead, it is used as an accessory to conditional subrange GET requests. Here’s what the spec says:

Informally, its meaning is `if the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity’.

Posted in Technical | Tagged , , | Leave a comment

Former Head of Citigroup Reflects

I just watched Bill Moyers interview John S. Reed, who retired from Citigroup in 2000, about the collapse of the financial industry. Many of the things John said confirm what I believe about what happened. Yet it seems suspiciously convenient that he left the company before the trouble really hit the fan. He called himself a “well-informed spectator”, but I find it hard to believe he was not more responsible than that. He was, after all, the head of Citicorp when it merged with Travelers Group, a move that went against Glass-Steagall (still in effect at the time), at least in spirit. This seems at odds with the criticism that John expressed during the interview against the repeal of Glass-Steagall. If combing retail banking with riskier financial services was a bad idea, why was he involved with the merger between Citicorp and Traveler’s Group?

Brief bio of John S. Reed on billmoyers.com: http://billmoyers.com/guest/john-s-reed/

Posted in Uncategorized | Leave a comment

Keeping Up

I just had a minor epiphany: not maintaining documentation is a vicious cycle. When documentation gets out of date, it becomes less useful. People don’t notice when stale documentation becomes more stale, because they’ve already stopped reading it. Many things in life seem to be this way. As the Red Queen explained, you must run as fast as you can just to stay in place. But I digress.

How do we break this cycle? One of my colleagues shared an interesting practice that other companies use: keeping detailed release notes. Instead of trying to update an entire document or corpus, you simply note the incremental changes. This is much easier, at least psychologically, because you do not have to pour over all existing documentation to make sure every word of it is up to date.

Over time, the system begins to diverge significantly from the original documentation. At that point, the original documentation needs to be revamped. If good release notes are kept, the pain of updating the obsolete documentation is greatly reduced, at least in theory.

I like the theory of this process. I wonder how well it would work in practice. Would it be hard to maintain? Would it actually make major overhauls significantly easier?

Posted in Uncategorized | Leave a comment

Terror Suspects

When I was young, I remember hearing a the repeated phrase “innocent until proven guilty”. I don’t remember where I heard it from, but it was probably on one of those television crime shows. In any case, I realized it had great cultural significance, even though I didn’t quite grasp what it was. Regardless of whether they’ve given it much thought, I’m sure that somehow, just about every American is familiar with this phrase.

I also remember a man Socratically asking me, “Is it worse to let a guilty man go free, or punish an innocent man?” I thought about it for a moment, and wasn’t sure. The man (I think he was a lawyer), taught me a very important lesson about how the justice system works in the US. He said that the system is based on the notion that it is better to let a guilty man go free. I wasn’t sure what to make of that; I felt torn. How could it be alright to not punish a guilty man? Furthermore, doesn’t letting him back on the street pose a danger to the rest of society? I pondered this lesson in the back of my mind, hoping it would one day make sense.

Eventually, I realized that the two concepts are related. If it is worse to punish an innocent man, then we better be pretty darn sure that people that we punish are actually guilty. Not coincidentally, this is how the system is designed. Jurors must be your “peers”, not specially chosen to get a conviction. They must find you to be guilty “beyond a reasonable doubt”. As a presumed innocent man, you can’t be searched without “probable cause”. You can’t find yourself in “double jeopardy”. The defense gets to make arguments after the prosecution. The prosecution cannot bring evidence without letting the defense know about it ahead of time. And you cannot be forced to testify against yourself. Basically, we try to give the defense every reasonable advantage to avoid punishing an innocent man, even though it increases the risk of letting a guilty man go free. Many of these points come from the Constitution itself; therefore, “innocent until proven guilty” is one of America’s core beliefs around which the legal system is designed.

Without these provisions, we can’t truly be free. Imagine a country where you can be searched whenever the government feels like it (possibly without you knowing), or you go to trial and your words carry no weight, because you are presumed guilty, and must prove your innocence. This may sound foreign, or perhaps even ridiculous, but it is indeed the case in other countries, and should not be taken for granted. The reason other countries do it differently isn’t necessarily because they’re evil bastards; not punishing criminals is not only bad justice, it lets “dangerous criminals” back on the streets, where they can hurt more people. In other words, letting a guilty person go is bad for security. This is why we will always be tempted to tilt the system in favor of the prosecution, but we must resist that temptation if we want to maintain our American identity.

That temptation is strongest in times of insecurity. For example, if you were Japanese during WWII, you were presumed to be working with the enemy, which meant that you needed to be held in captivity despite there not being any evidence against you specifically. Therefore, it is no surprise that in this post-9/11 era, we are again facing this temptation. Perhaps somewhat surprising has been our reaction, in particular Guantanamo. Certainly it is disappointing. A couple of recent articles in the New York Times reminds us why we chose the legal system that we have; those articles show how we do wrong when we yield to this temptation.

At the beginning of one of those stories, Murat Kurnaz was relieved when he was handed over to Americans when he was detained in Pakistan. “Surely,” he thought, “they will know how to treat an innocent man decently.” Whatever respect he had for the American way of justice was soon shattered as he was shipped off to Guantanamo. By the end of his experience, I’m sure he had a much different view of American just, a much less admiring view. If it were not for his family working on his behalf, the US probably would never have let him go. This was a catastrophic failure for our goal of not punishing an innocent man. Unfortunately, Mr. Kurnaz’s story is not an isolated one.

All too often, people (particularly public figures) speak of prisoners at Guantanamo as presumed “terrorists”, as if those who brought the prisoners there have some magical ability to tell appart the innocent from the guilty. A much more accurate term would be “suspected terrorists”. Of course, putting a qualifier before the word “terrorist” really takes the force out of whatever it is people are trying to say about Guantanamo, and how we need to keep the prisoners that we have there locked up forever. It just doesn’t sound as good in a sound bite, not to mention the cognitive dissonance inflicted on the spearker.

I have no idea how many of the prisoners we have in Guantanamo are actually terrorists, but based on what I’ve read, the government doesn’t have a much clearer idea either. That’s why we now have this thing called “indefinite detention”. It’s not a prison sentence, because that would imply that the prisoners have been convicted in a legitimate trial. Instead, it is a state of limbo, a fiction that we’ve invented, because we’ve convinced ourselves (at least those in power) that it’s the only way to protect America from the evil-doers.

I guess if the Constitution doesn’t give us a way to convict people that we are sure are guilty, then it must be pretty broken. I wonder how the founding fathers would feel if we told them that. They must be turning over in their graves right now.

PS: The other Times story from the Sunday Review about a Guantanamo prisoner who was freed after being held for years is here.

Posted in Uncategorized | 2 Comments