Friday, June 5, 2009

Platonism and Object-Oriented Programming, or, A Post In Which I Get in Over My Head

I'm reading a book called Anathem by my favorite author Neal Stephenson. One of the things that I love about reading Stephenson is that he writes great, suspenseful, gripping fiction but he salts it heavily with discussions about some high-level topic. His books have dealt with cryptography, nanotechnology, and language. Anathem deals heavily in the philosophy of platonism. This may not seem like the stuff of a great novel, but I found it interesting enough to read up on it a bit.

According to the Stanford Encyclopedia of Philosophy (http://plato.stanford.edu/entries/platonism/):
Platonism is the view that there exist abstract (that is, non-spatial, non-temporal) objects. Because abstract objects are wholly non-spatiotemporal, it follows that they are also entirely non-physical (they do not exist in the physical world and are not made of physical stuff) and non-mental (they are not minds or ideas in minds; the are not disembodied souls, or Gods, or anything else along these lines).

Yeah, I have no idea either, but the examples help:

Consider the sentence ‘3 is prime’. This sentence seems to say something about a particular object, namely, the number 3. Just as the sentence ‘The moon is round’ says something about the moon, so too ‘3 is prime’ seems to say something about the number 3. But what is the number 3? There are a few different views that one might endorse here, but the platonist view is that 3 is an abstract object. On this view, 3 is a real and objective thing that, like the moon, exists independently of us and our thinking (i.e., it is not just an idea in our heads). But according to platonism, 3 is different from the moon in that it is not a physical object; it is wholly non-physical, non-mental, and causally inert, and it does not exist in space or time. One might put this metaphorically by saying that on the platonist view, numbers exist “in platonic heaven”. But we should not infer from this that according to platonism, numbers exist in a place; they do not, for the concept of a place is a physical, spatial concept. It is more accurate to say that on the platonist view, numbers exist (independently of us and our thoughts) but do not exist in space and time.

Similarly, many philosophers take a platonistic view of properties. Consider, for instance, the property of being red. According to the platonist view of properties, the property of redness exists independently of any red thing. There are red balls and red houses and red shirts, and these all exist in the physical world. But platonists about properties believe that in addition to these things, redness — the property itself — also exists, and according to platonists, this property is an abstract object. Ordinary red objects are said to exemplify or instantiate redness. Plato said that they participate in redness, but this suggests a causal relationship between red objects and redness, and again, contemporary platonists would reject this.

OK, so the basic idea is that there are these ideal things that exist independent of us, but that don't exist in space or time. Physical objects may instantiate those things in one form or another. Every equilateral triangle I draw instantiates the ideal form of an equilateral triangle.

So that's the platonism part of the post. What does that have to do with object-oriented programming? By this point, any OO programmer has figured it out, based on the word "instantiate." That's a very common OOP concept. For a non-programmer, let me try a brief intro to OOP. Let's suppose you're making a computer game with a bunch of little robots. Each of these robots has different properties (arms, legs, etc.) and different actions (move forward, left turn, right turn, etc.). You could each little robot separately by hand. That's fine but it takes time and you might make mistakes and one of your little robots won't work right. Or, you could code a robot "object" (hence "object" oriented programming). This robot "object" doesn't, in itself do anything. It just contains all the basic code each of your robots is going to need. Then, when you want to put an actual robot on the screen, you "instantiate" an instance of the robot object. Need another robot? Don't reinvent the wheel, just instantiate the robot object again.

So you see that object-oriented programming isn't just a convenient way of making computers do things, it also seems to embody an entire school of philosophy. I made this connection myself, but a google search for platonism and object-oriented programming showed me that it is a well-established connection.

At this point, I should note that when Neal Stephenson is not writing, he spends a lot of time coding. He even had a part time job as a coder, not for the money, but because he wanted to do something different with his brain than write fiction. So I have no doubt that Neal understands this connection and my only question is whether his interest in platonism came from his programming or whether he sort of "discovered" the connection the way I did.

Why blog about this? Partly because I was surprised to find something so pragmatic and functional as a computer programming language might embody a philosophical system and I wanted to share it. And partly because I think it says a lot about the nature of human creativity. Philosophers dream up an idea about the world; someone decides, "hey this might work as a programming language" and someone else decides, "hey this would be interesting to explore in a novel." It makes me wonder whether there are other approaches to programming based on other philosophies. It makes me wonder whether there might be wholly different ways of organizing computer technology that would work better if only we had a better philosophy to start with. And it reminds me of why novels and fiction are important because I wouldn't have learned any of this stuff from a philosophy book.

Monday, April 27, 2009

Everything Old is New Again

The New York Times has a story about a website started by an 18 year old high school student in Vermont called Omegle (the website, not the high school student). The idea of the website is to let people chat with random strangers rather than someone they already know. As our student so wisely says, "You can’t learn anything from someone exactly like you."

Of course, for those of us who remember the Internet's early days, chatting with random strangers has a long history. In fact, I happen to know a married couple who met via a totally random MSN Messenger chat. I can remember random chats on CompuServe and AOL and ICQ and even (if I remember correctly) early versions of Skype. The whole concept of being able to chat for free with someone from anywhere in the world was one of the "gee whiz" Internet concepts right up until everyone realized that these chats don't tend to produce much in the way of learning about the world or other people. Indeed, Omegle doesn't seem to have solved the fundamental problem, summed up in the article by Jason Tanz, a senior editor at Wired:
"The first person I connected with said, 'let’s have cyber right now,'" he said of his experience on Omegle, referring to cybersex. "The second was a 14-year-old kid from London. It’s not hard to see how this is going to be a problem."

At any rate, the point is not whether Omegle is a good idea or a bad idea. The point is that to an 18 year old high school student it's a new idea. There's probably a lesson in here for would-be Internet entrepreneurs or anyone who wants to make money off of young people. The lesson is something like, think of something you used to like doing when you were a kid that people don't do anymore. Update it slightly and then have the confidence to release it into the world as though you were the first person ever to have thought of it. Otherwise you might get beat out by an 18 year old who doesn't know that he didn't invent anyway.

Saturday, April 25, 2009

Book Review: Fooled by Randomness


I hadn't intended this blog to become a collection of book reviews, but I've come to like the idea of keeping a log of my thoughts on the books I've read. If for no other reason, keeping a book-review blog helps me to feel OK about actually donating a book to our favorite non-profit bookstore (Books for America) after I've finished reading it. Anyone who's seen our bookcase can attest that Nicole and I have a book problem.

As for the book Fooled by Randomness by Nassim Nicholas Taleb, there's far too much packed in to do any kind of justice to the book in a reasonable summary. Indeed, my main criticism of the book is that it is poorly written. It's very discursive and often he brings up topics that you would really already have to know something about in order to understand what he's saying. Sometimes I did and sometimes I didn't. In fact, in a postscript, Taleb mentions how boring he finds writing if he's confined to an outline or a deadline or a page limit. He just wants to let it fly and the book reads a lot like the author was writing for himself and is only letting you along for the ride. And this is a shame because this book really has some important and profound things to say.

Basically the book is about how we human beings are constantly trying to tell ourselves a story about what has happened and why it happened. And we almost never want to tell ourselves that something has happened for no reason other than a random, meaningless fluctuation. Even when we know better at some level, we cling to emotional explanations for random events. Taleb's villians are CEOs, bankers, journalists and historians who all try to make money by explaining things that are actually random. Think about it: if you watch the nightly news, every day you hear that the Dow was up or down some amount (which is usually a pretty small percentage change) and then they tell you why. Millions of transactions occurred that day and, if you add them all together, the result was that the market moved a tiny, tiny bit. Isn't the most logical explanation that, in fact, nothing happened today. People traded stocks for whatever reasons (someone is retiring and selling, someone else if saving for retirement buying and neither side of that transaction much cares about whatever went on today) and the market just moved randomly a bit. Day after day. People used to think that the weather was being dictated by the gods too. And they used to pay shamans to make the weather better. Today we think we've evolved, but is your investment adviser really earning his or her keep or they just betting on sun in the summer and snow in the winter and taking credit for being brilliant?

Taleb makes pains to point out however that we are all susceptible to emotional thinking about random events. It's in our nature. And here, the book moves beyond being about investments or markets or the financial crisis or MBAs. It really becomes a book about philosophy. (Indeed there's a section about philosopher John Popper that I didn't really get, except that he's Taleb's favorite philosopher). Because we're not in control of our lives, Taleb favors a stoic disposition. Treat each fortune and misfortune with the same equanimity and you will have risen above the randomness of markets, weather, cancer diagnosis, car accidents and love. I'm not convinced about the philosophy, but I do appreciate the book's call for us to stop inventing stories where none exist. And in this sense, the book is very similar to Malcolm Gladwell's Outliers, reviewed below. We constantly hear stories about why and how this one person succeeded but rarely about how and why all the others failed. Because if we heard about the hows and whys of the failures we might come away with the conclusion that the successful person is just lucky. Taleb certainly would think so.

I can't quite recommend the book, if only because Taleb has (by his own admission) re-written it in a book called The Black Swan. I'll probably read that too in the hopes that someone took a stronger editorial hand in that one. If not, he's supposed to be coming out with a third book which will be the same stuff told in yet another way (again, to his credit, he admits this). So stay tuned for those reviews. In the meantime I might start thinking about things to post that aren't book reviews.

Thursday, March 26, 2009

Book Review: Malcolm Gladwell's Outliers



I read Malcom Gladwell's Outliers this morning (ok, I skimmed some parts but I think that counts, see my post on How to Talk About Books You Haven't Read). The book is quite enjoyable and very well written. The fact that I was able to read most of a 200+ page book in a morning is a testament to that. It's also eminently skimmable because Gladwell likes to tell stories but you can read the setup and the conclusion and skim the interior parts.

The book has two theses, only one of which is captured by the title. The "Outliers" thesis is that super-successful people, aka society's outliers, get where they are through luck. Luck does not replace talent, intelligence or hard work, etc. Those things are necessary but not sufficient to make you a Bill Gates or a Beatles, or an NHL hockey player. What matters is that you are born in the right place at the right time in order to be able to have opportunities to perfect some skill that others do not get. In some cases, these opportunities are very specific: Bill Gates, Steve Jobs and others who were born at the right time to take advantage of the computer revolution and who had truly extraordinary opportunities as kids to learn to program. Gladwell similarly profiles a group of Jewish New York lawyers born in the 1930s with parents in the garment industry. (Which may not sound like a recipe for success but Gladwell is convincing on this point.) Gladwell's thesis is that it takes 10,000 hours of practice to be truly great at something. That's about 10 years. When the personal computer revolution took off only a small handful of people had 10 years of programming experience AND were young enough to bet their futures on a crazy idea (a computer for everyone) rather than get safe IBM jobs. Even the child prodigy Mozart is an example not of innate ability but of the power of practice. By 17 he already had 10 years of composing experience and his early works are (a) not that good, and (b) probably "cleaned up" by his father who took down his notation.

Gladwell's second thesis is interesting but not as convincing and a bit hard to pin down. It's not about "outliers" at all, but rather it's about how our cultural background shapes our ability to succeed. This is dangerous ground, not because there aren't good examples of one culture being better at something than another, but because it's dangerous to generalize from specifics. So Gladwell convincingly shows that at least a handful of airplane crashes were caused by (Korean or Brazilian) co-pilots being too deferential to pilots. Korea and Brazil, apparently, are cultures that are highly deferential to authority but in an airplane cockpit this can be deadly. Now, that's a fine observation and Korean Air has put in a place a program to re-train flight crews that is probably a good thing. But how far does that take us? And what in the heck does this have to do with whether or not someone is an outlier?

Gladwell tries to bridge the gap by arguing (seriously) that Asians are better at math because they come from a rice cultivating culture which rewards patience and persistence (and because they can literally say the words for numbers in one syllable making a string of numbers easier to memorize). By contrast, Westerners give up too easily on math because they don't believe that hard work pays off when it comes to math problems. Again, the idea that maybe Western kids should be taught that math success is related to work and not some innate math ability is a good one that should be spread far and wide. And I suppose if Asian kids get their 10,000 hours of math in much faster than Western kids we might see more math outliers from their culture. But so what? It's just not clear what the point is of this cultural difference thesis. So being a Jewish New York lawyer in the 1930s was helpful if you wanted to found a successful firm. Why? Largely because these particular lawyers were discriminated against and couldn't get jobs at the elite firms. They had to start their own firms and take on work that the elite firms though was beneath them. But that work turned out to be things like hostile takeover litigation which became huge in the 70s and 80s.

Ultimately Gladwell's book is a good read, if for no other reason than it makes you feel better about not being a super-genius (he profiles and honest-to-goodness super genius whose life has basically sucked). And he's spot on when he says that there are way more 1600 SAT 4.0 GPA kids than Harvard can ever take and so it ought to just have a lottery instead of this fiction that it has sorted through them and picked the best, Harvard-worthy, kids. But his point is a bit depressing even though valid. You might be smart and able but without being in the right place at the right time you won't be an outlier, just an ordinary successful person. And if do achieve an unusual success it might have been luck as much as anything. Beyond that, I suppose his point is that we're prisoners of our culture and there are some things we might do well (like tell the pilot he'd damned well better not try to fly through that thunderstorm) and some things we do not do as well as other cultures (math). OK. Thanks, Malcolm. What was I supposed to do with information? Not much I suppose, but if you figure it out and you're able to get lucky and capitalize on it before anyone else, maybe you too can be an outlier.

Saturday, January 10, 2009

Book Review: When Genius Failed



The second book I read on finance (OK, listened to on Audible) was When Genius Failed by Roger Lowenstein. It was a great follow-up to Liar's Poker because it follows John Meriwether, a key figure at Solomon Brothers in the 1980s and, thus, a key figure in Liar's Poker. Meriwether was one of the top traders at Solomon and he had one particular stroke of genius: to find other geniuses to tell him how to trade. Meriwether saw early on that a set of super-geniuses who were applying rocket-science to trading might be able to make a heck of a lot of money if they got out of the ivory tower and on to the trading floor. In one of my favorite passages in the book, Meriwether calls up a Harvard professor to try to poach one of his grad. students and the professor offers himself instead.

Meriwether and his group were incredibly successful, he but ended up leaving over a bond trading scandal. Pressing on, Meriwether took his group from Solomon and started a hedge fund called Long Term Capital Management (LTCM). He hired a former Vice Chairman of the Federal Reserve. He hired two of the most highly respected financial economists around (John Merton and Fischer Black, both of whom would win the Nobel Prize while working for LTCM). These guys were so smart that they thought they couldn't lose. They had incredibly complex and intricate computer models that told them that the odds of losing all their money were so low, you wouldn't expect it to ever happen in the history of the universe. Guess what?

Long story short, LTCM lost it all and had to be bailed out. The government didn't offer any funds, but the New York Fed. called all the big Wall Street bankers into a room and basically ordered them to work it out. (The one firm that wouldn't play ball? Bear Stearns.)

The book is well written and provides interesting pictures of the LTCM principals, though some of the detail about trading strategies is a bit dry and long. But what's amazing about this book is that, much like Liar's Poker which was written a decade before, everything that is falling apart now was falling apart then and no one seems to have learned. After LTCM (and after Lowenstein's brilliant deconstruction of what went wrong) it's flabbergasting to think that in 2006 the same banks that had to bail out LTCM were convinced, utterly, that they couldn't loose money on subprime mortgages because housing prices never fall!

Reading this book makes me think of the people who stayed in New Orleans because they'd been through hurricanes before and figured they could make it through Katrina. That attitude seemed to pervade our entire financial system. The tragedy of LTCM is that it perversely made people in power feel optimistic that any problems like that could be dealt with and solved. But the Category 5 subprime crisis hit and all the financial levies broke, and now we're in the midst of the greatest crisis since the Great Depression. Just like New Orleans, the warning signs were all there and Lowenstein meticulously flagged and catalogued them in When Genius Failed.

Monday, January 5, 2009

Book Review: Liar's Poker



So what with working at the Federal Reserve and with the economy falling apart, I've been on a financial book reading kick lately. I thought I'd start reviewing the books I'm reading. I should note that nothing I do at the Fed really has to do with economic policy so these opinions are my own.

First up, is a book I found at our favorite used book store that they were about to toss: Liar's Poker by Michael Lewis. It chronicles his years in the mid-1980s working as a banker at Solomon Brothers. It's a fun, witty and probably accurate portrayal of people who are hyper-competitive, very rich, and, it seems, out of control. Not out of control personally--these aren't people going to Studio 54 and doing lines of coke. Instead, they seem out of control in the wizardry of their financial dealings, and the way they live with and profit from conflicts of interest. Lewis seems to be saying, "Look at the way these people operate and tell me how it can last much longer?" Stunningly, of course, it lasted another 20 years. (Wall Street's ways lasted that long, Solomon did not).

The book also contains a fascinating description of Lewis Ranieri and his invention (not too strong a word) of the mortgage-backed securities market. No one could conceive of any use for these things until Washington changed the rules for the Savings & Loan industry (leading eventually to insane overreaching by the S&Ls; a crash; and a huge bailout in the early 1990s -- sound familiar?). Although the products got more complex and the markets got bigger and bigger, all the things that ended up going wrong are right there in this book, written 20 years ago. The wonder is not that it all came crashing down, the wonder is that it lasted as long as it did.

Wednesday, November 5, 2008

What, me worry?

A second post-election piece I didn't post at the time I wrote it (Nov. 5):

I've explained why I voted for Obama and I don't regret it today. But I am feeling a bit defensive because I've seen some emails from McCain voters that make important points and I hope I can provide some reassurance to my conservative friends.

First, I've been thinking about the political shortcomings of the Baby Boom generation for some time (well before Obama was on the scene). And perhaps more than anything I felt we needed a President who wasn't defined by the Vietnam War. I saw a documentary the other night about the 1968 Democratic Convention in Chicago and I can see how each side thought the other was out to destroy the fabric of America. But it's not like that anymore and I'm tired of the silliness of it. Negative ads are fine if they help define the issues, and yes, I believe character still matters. But Elizabeth Dole's ads claiming her Sunday school teacher opponent was a closet atheist probably helped tip my vote. It was manipulative, irresponsible and personally and spiritually hateful. You know, for years Republicans have tried to convince minority voters that if they only vote for one party all the time they'll be (and have been) taken for granted. Well, the same holds true for Christian conservatives.

Second, I'm honestly not sure if I would have voted for Obama if I hadn't actually met the guy and, as President Bush famously said of Vladmir Putin, "gained a sense of his soul." Obama was a professor at my law school and I took a seminar from him. I got no sense that he's a radical, that's he's not pro-America, or that he's a socialist. If I'm right about Obama, the far left blogosphere is going to be deeply disappointed in his presidency. If I'm wrong about him (and look how well this looking-into-his-soul thing worked out for GW Bush w/r/t Putin) then I'll be very disappointed. In fact, a couple of my old law school professors recently had a debate on "whether conservatives should vote for Obama." Prof. Cass Sunstein, who is very liberal, made the case that conservatives should vote for Obama because, well, because he doesn't think Obama is really as liberal as his voting record and his anti-NAFTA campaigning in the primary would suggest. My best sense is that Sunstein is right. Imagine Clinton without the the sex and the lies and things don't seem too bad.

Third, look, I have to say that the top of the Republican ticket, John McCain is not a conservative except on a few social issues. McCain wasn't a conservative in 2000 and that's why he lost the primary. He pretended to be one this year but I didn't buy it. McCain voted against the Bush tax cuts. He came around on those because he knew he had to. But his economic instincts are not conservative and on any other issue I didn't trust him to govern as a conservative (his response to the foreclosure crisis and financial meltdown - a housing rescue plan of some $300 billion and blaming "greed on Wall Street"- sounded a lot like Chuck Schumer to me). If we're going to have socialism in this country I'd rather come by it honestly.

My last line of defense is this: Ronald Reagan started out as a Democrat. And he always said that he didn't leave the Democratic Party, but that the party left him. The Republicans are in the wilderness because of Tom Delay, Ted Stevens, No Child Left Behind, "You're doing a heck of job Brownie" cronyism, etc.