thoughts about some things

  • the view from the left

    We live in a right-handed world. Most people don’t notice it, particularly you righties, but it’s the truth: our world favors the right side. And realistically, that’s probably how things should be, since the majority of people are right-handed. Wikipedia puts the estimate at 90-93%, or only 7-10% lefties. Still, I was interested (and proud) to read that Barack Obama is a fellow southpaw, as were four of the last six presidents.

    Today I thought it would be interesting to take stock of just how many things give preference to the right hand. This partial list was compiled over the last month, and while I don’t claim that any of these were deliberately designed to favor righties, I also don’t claim that they weren’t.

    Cameras: Almost all of the interesting controls are on the right.

    Can openers: Hold ’em with the left, crank ’em with the right.

    Cars: In the US, almost all of the controls are on the right side. Could you righties shift with your left hand? Brits, don’t answer that.

    Computer mice: Many can be used by either hand, but they’re usually on the right side and (by default) expect to be clicked with the right index finger. Some can’t even be used by the left hand without extreme awkwardness.

    Corkscrews and screwdrivers: Usable by either hand, but you can get a lot more leverage in the tightening direction if you use them right-handed.

    Iced tea makers: With mine, the pitcher goes on the right, to be picked up by the right hand. My left hand gets to hit the button, though, so maybe it’s a wash.

    Microwaves and toaster ovens: Controls are almost always on the right side.

    Toilets: I can’t speak for other countries, but in America, the majority of toilets have the flush handle on the left (as you’re facing the thing). That’s because the right hand is too good for such distasteful work. In fact, in some countries it’s actually a horrible insult to offer your left hand to someone, because it’s assumed that you use that hand for wiping.

    Scissors: Try using a fancy pair of sewing scissors with your left hand. It doesn’t work. Interestingly, I seem to have learned to cut right-handed very early on, and never ended up needing the left-handed scissors my parents always bought me.

    Sewing machines: Speaking of sewing, all of the interesting sewing machine controls are on the right, too.

    Watches: Wound by the right hand, unless you wear yours on the right wrist, in which case you probably have to take it off to wind it.

    Wedding rings: In the US and some other countries, wedding rings are worn on the left hand. As a lefty, I find it frustrating to have a chunk of metal on my dominant hand – it’s far too easy to accidentally scratch things.

    The English language (and lots of others): Boy, there’s a lot to say here. First of all, try writing an essay in pencil with your left hand. Don’t spend all afternoon, just fill one page. Then take a look at the outside edge of your hand. Your skin should now have a nice silvery coating of graphite, and you’re going to leave smudges until you wash your hands. It’s gross. Also, if you happened to choose a spiral notebook for your experiment, did you notice how incredibly uncomfortable it was to have your hand mashed against the spirals? Yeah, elementary school sucked.

    Now, there are some advantages to being a lefty, such as a higher chance of being ambidextrous. I have always assumed that this was because we lefties are more frequently required to use our non-dominant hand for things (as demonstrated by the previous list), but I have no proof of this. Lefties are also reputed to be more creative, and some evidence suggests that we’re better at multitasking.

    Overall, I’d have to say that I’m quite happy to be a lefty. I feel like a member of an exclusive club. It’s still fun to imagine throwing you righties into a left-handed world, though.

  • a hofstadter moment

    (or, why platypuses don’t make good biologists)

    Douglas Hofstadter loves the idea of self-reference. As a cognitive scientist, author, composer, and teacher, his works commonly refer back to themselves or fold in on themselves in strange and delightful ways. His recent book I Am a Strange Loop is all about self-reference, and I can’t recommend it highly enough. A few years ago I had what I would call a Hofstadter Moment, a surprising and unexpected case of self-reference. It came as I was developing Foogle, a tool to index and search computer code.

    As a software developer, I work every day with a code base made up of many thousands of files, containing among them millions of lines of code. I often need to search this code, to find where and how different parts of the system are used. Having grown accustomed to Google and its ability to instantaneously search billions of Web pages, waiting five or ten minutes for Windows Search to find what I was looking for just didn’t cut it. So I decided to write a tool that could index our code every night, and let me perform fast and accurate searches of that index any time I needed. In homage to Google (my favorite search engine) and “foo” (the official nonsense-word of programmers everywhere), I decided to call the tool Foogle.

    Foogle’s job would be to scan through each code file, break it up into individual parts (‘tokens’, in programmer-speak), and add an entry for each part to the index, which could later be searched. This would be very much like indexing a book, where you would separate the text on each page into individual words, and then add the words of interest to the index. The big difference is that computer code isn’t nearly as easy to decipher as the written word – it tends to look like an explosion of letters and punctuation. This meant that the code for tokenizing a file was relatively tricky to write.

    Once I had a working prototype, I turned it loose to start indexing code. First I tried it on some simple, made-up code files, and things worked pretty well. Then I tried letting it index our entire “utilities” folder, which happened to contain the code for Foogle itself. Much to my surprise, when it hit the Foogle code, it broke – it couldn’t index itself. Not only that, but as I investigated further, I was amazed to find that the line of code that couldn’t be indexed was the very line of code that had the bug! 

    This line of code, when running as part of a program, was unable to cope with its own written representation. It’s a bit like the double-take you might experience when reading the following: “I like the color red” (psychologists call this the Stroop effect).

    As it turned out, fixing the problem was relatively easy, and before long I had a working program. Still, this was one of the most interesting bugs I’ve ever found, purely because of its strange, self-referential nature. It seemed rather like a platypus trying to be a biologist. With their furry bodies and duck-like bills, their laying of eggs and nursing of young, platypuses1 just don’t properly conform to any of the standard animal categories. Imagine a platypus as a biologist, on the day when it walks past a mirror and realizes that it can’t even categorize itself!

    1. You might say I’m wrong and that ‘platypi’ is the correct form. However, I’ve consulted Wikipedia, and I stand by my ‘platypuses’ (and my platypuses).

  • polarization

    Today I noticed something interesting on the way home. I was riding the bus, looking up at the display (an LCD) which normally shows the time of day and various information about where we were five minutes ago. The display is made up of fifteen or so panels, each of which displays one letter or digit. As usual, the displayed time was off by an hour or so, but that’s not what interested me. No, the weird thing was that one of the panels was nearly black, while the rest were a sort of cheery orange-yellow color.

    I stared at it for a bit, and noticed that as my head moved around the appearance of the panel changed. Eventually I discovered that if I looked directly through my sunglasses, the panel was black, but if I looked over the top of the glasses, it looked just like the others. Tilting my head left and right as I looked through the sunglasses yielded various intermediate colors, and putting the glasses frame right over the panel gave it a sort of split effect.

    A bit of physics

    It turns out that LCDs are polarized, as are my sunglasses. Briefly, polarizing filters block (or pass) light based on how the squiggles of each light wave are oriented: if the light is oriented on the same axis as the filter, it gets through, otherwise it doesn’t. Actually, somewhere between all and none of the light gets through, depending on how close the orientations of wave and filter are. Here’s a picture to help visualize it, showing unpolarized light passing through a vertically-oriented polarizing filter:

    (click the image to read the entire article)

    As you can see, only the vertical “component” of the wave makes it past the filter.

    Normal ambient light, from the sun and most typical light sources, is composed of zillions of light waves, all with different polarization. This means that if you put on a pair of polarized sunglasses, things look a bit darker, because some of those waves have been blocked, but things look more or less like they did before. The interesting effects show up when the light hitting your sunglasses is already polarized for some reason, like the light coming out of the LCD on the bus. Apparently most of the panels on the display were polarized in approximately the same direction as my glasses were, but that one weird panel was close to 90 degrees different, so that together they filtered out almost everything. Another place you’ll notice this is car windshields, which often take on an odd bubbled-rippled-rainbowy look, because of how they’re pressure-treated at the factory.

    Anyway, I highly recommend getting yourself some of these sunglasses, and then wandering around to see what you notice. As a bonus, they also work really well for their intended use, namely making it easier to see in bright light.

    A bit of politics

    As I sat there and tilted my head around like a goof, watching how the LCD panel got lighter and darker, I got to thinking about a more common use of the word “polarize”, namely https://en.wiktionary.org/wiki/polarize: “To cause a group to be divided into extremes”. I was particularly thinking about how, in my eyes, that LCD looked totally different than it did to the rest of the people on the bus. They saw a normal time display, and I saw “6:1▮ PM”. Whose view was the right one? In this case, it’s pretty clear that I was in the minority, but it sure looked weird to me.

    It’s even more interesting when you consider the broader picture, with a hotly-contested presidential election on the horizon and an economy staggering toward the unknown. Political and economic polarization are as strong now as they ever have been, and I can’t help but wonder if our own mental filters make it really hard for us to see the world clearly. I know how the world looks to me, but that’s just one perspective: that of a middle-class Democrat with (I hope) a secure job. The problem with biases (and polarized sunglasses) is that it’s really easy to forget they’re there. Am I missing something really important because I’m so focused on getting a Democrat into the White House? Have some Republicans been partially blinded by their heartfelt conviction that we have to win before we can leave Iraq?

    I don’t know, but it’s worth thinking about.

  • 17,000 heads are better than one

    StackOverflow.com opened for business about a month ago. It’s dedicated to asking and answering concrete questions about programming. It already has more than 17,000 registered users, who have asked more than 31,000 questions. More than 90% of these questions have at least one useful response.

    This is great news for programmers.

    You probably know that computers are stupid, as evidenced by the incredible frustration they often cause. Programmers are tasked with training these blazingly fast mechanical morons to do useful tasks, and even the buggiest program probably represents hundreds or thousands of hours of someone’s time. Everything your word processor or email program does, every button and graphic, somebody made that happen. And it’s not easy.

    I recently had to implement printing in a basic graphing application. Going into it, I told several people that I figured it should be pretty straightforward, maybe a day or two of work. I’ve been doing this for almost ten years, so I figured I ought to be able to sort it out. But unless you’re working on a system that’s designed around paper (e.g. Microsoft Word), printing is a pain. You have to completely reconsider how to display the data so that it works on the printed page. In the end it took at least a week of work to get a solid implementation. I probably only wrote a few hundred lines of code, which isn’t a lot. The problem was that I’ve never done it before, and neither had any of my coworkers.

    One of the most important tools of in any programmer’s toolbox is other programmers. What might take hours or days to figure out on your own can often be solved in minutes by someone who has done it before. Certainly it’s also satisfying to figure something out yourself, but I’m not always in the mood. Sometimes I just want an answer so that I can go home for the day. Often coworkers fill this role, since they’re just an office away. But what if nobody at the company has ever done printing before? Or what if you’re working solo?

    That’s where StackOverflow comes in. With thousands of programmers on call, even the most esoteric question can find an answer in short order. It’s often only a matter of minutes before a question gets its first answer. And if the first answer doesn’t work, the second one or the third one might. You might even find out that a bunch of other people have already tried what you’re doing and they all figured out that it wasn’t feasible. It’s sure nice to know that before

     you spend hours and hours trying to do it.

    This is great news for all of us, because it means less time banging our heads on the table and more time making software. So far I haven’t needed it for anything terribly important, but I sleep better knowing that it’s out there.

  • why write a blog?

    I seem to spend more and more time these days reading people’s blogs. One of those bloggers wasn’t content for me to read his blog: he wants me (and everyone else) to write one of their own. So here I am. I have no idea if what I say will be of any interest, but there it is.

    http://steve.yegge.googlepages.com/you-should-write-blogs