Efficiency in Algorithms Everywhere

Posted on March 2nd, 2010 by benhamill | No Comments »

I have heard UI folks talk a lot about how everything has a UI. Doors have a UI, you know? If there’s a horizontal bar, it’s clear that you’re supposed to push. If there’s a vertical bar, that invites you to pull. It’s a poor UI if you walk up and the door looks like it wants you to pull, but, in fact, requires you to push. I’ve been seeing UIs everywhere since I first heard this idea.

I realized just the other day that I also look for efficient algorithms everywhere. I think I may have been doing it for years and just not realized it. Maybe other people do this, too, but I’ve never heard anyone say it out loud in quite this way. Maybe I’m insane or OCD. I’m just going to present some that catch my eye frequently (or have recently, anyway) and rant about them. How’s that for a thesis?

The Cash Register

I often buy things at stores. Most of my transactions are via credit card. Especially when I’m buying, say, lunch, the transaction is so small that the store doesn’t ask me for my signature (let alone ID). So after placing my order, the employee tells me the total and I hand over my card. They then swipe it and stand there while we both wait for the receipt to print out and the register to see that the transaction went through. Then I get handed back a receipt (maybe with an order number) and card at the same time. I have to keep the receipt out and put the card back in my wallet. I may also have to carry away a cup to be filled with soda.

Frequently as I’m handed my receipt and card at once I’m told, “ThankyouforcomingtoRestauranthaveaniceday?” in a big rush and then glared at because it takes me a second to put my card away, pick up my receipt and cup and move along. If time is such a big deal (and during a lunch rush, let us understand that it is) that you’ll glare at a paying customer over it, perhaps an ounce of algorithmic analysis should go into minimizing it, no? If, for instance, I was handed the card back immediately, then I could put it away and be done with it before I am handed a receipt and cup. Then I can immediately move and let the next customer up. This increases the number of times the employee has to reach across the register and the number of times I have to reach to meet them, but that action takes much less time than it does for me to operate my wallet or for the credit card machine to get a response from the credit card validation server. It bugs me.

The Bus

Some people seem to think that there are two discreet tasks when boarding the bus: Waiting-in-line-to-pay-and-board and swiping-card-or-paying. This is sort of ridiculous to me. Clearly you can get your money or card out while you wait. In fact, unless you just managed to catch it in time, you probably saw the bus coming a block away or so, which gives you plenty of time to discover that your bus card is not in the pocket of your backpack that you thought it was and frantically search for it before (whew) finding it… all without making several other people wait.

What would be even more speedy, though, would be to be more organized on an even higher level: always keep your bus pass in the same place (infrequent riders, of course, won’t benefit from this). I generally ride by bike when I take the bus, which means I have to load the bike on the front before boarding. It’s not really possible to load it while holding a bus card, but I still manage to have it out and ready by the time I walk around to the front door and pay terminal thing. That’s because it’s always in the same spot in my wallet.

Making Titles For Wrap-Up Sections Sucks

The connection of this post to programming is perhaps tenuous, but hopefully you can see where I’m going. I wish laypeople knew just a little about thinking in this way and applied it to stuff like this. I like to think doing so has made my life easier and I feel like it’s let me be more courteous to those around me.

Also, this was intended to be my February post, but I was trying to come up with another example. In the interest of staying in the habit of posting, though, I’m just going to hit publish and call it done. Feel free to complain about that in the comments.

Thoughts on Google Wave

Posted on December 22nd, 2009 by benhamill | No Comments »

The buzz about Google Wave has worn off considerably (I’ve been unable to hand out the 18 Wave invites I have; if you want one, send me an email), but I also feel like I’ve used it enough to talk about it intelligently. I hear a lot of people still speak about Wave with confusion. They ask things like, “What is it for?” and “What am I supposed to do?”. People talk about running out of things to do in Wave. I’ve never really understood the thinking that leads to these quandaries. I tried analyzing it to understand it, but I don’t get it. So I’m going to try to explain how I’ve been thinking of it and hope that someone else can maybe bridge the gap for me.

What Is It For?

In a word: collaboration. It is not quite email and not quite AIM and not quite a wiki. It’s all of them. If you’re willing to wave someone instead of emailing them, you’ll get only a little bit of win out of Wave, which is that you can add someone in later, go back to edit old content and reply in line. That’s nice and all, but I think not enough that people really notice. Especially if the other person they’re trying to communicate with isn’t checking waves frequently.

The real win, in my experience, has been when I’m working with someone on some kind of document. For instance, some buddies and I want to put together a Gowalla Trip around the UT Campus. We started with a snippet that just had a big bulleted list of ideas from me. Below that, we discussed other ideas to add or not and all three added them to the list. Then we’ve been going around making the Spots and when we do, we add the url to the listing. It’s been a wonderful work flow; some of it has been real-time like a chat room and some of it has been asynchronous like email.

Similarly, I was working on some code and couldn’t figure out what was going wrong with a specific bit of it. I IMed a co-worker about it and he was trying to help me, but it was cumbersome because he couldn’t see the code (it’s a big campus). We switched over to a wave, where I pasted the code in. He could see it, edit it, reply in the middle of it. So much more efficient than using AIM.

So that’s the trick. Wave doesn’t have a lot of win over email if you’re telling your mom when to come over for dinner next weekend. It has a lot of win when you’re working with someone on some kind of document.

I Ran Out Of Things To Do

Well, yeah. That’s a bit like saying you ran out of things to do with your table saw. The same charge could be levied at gmail: if you don’t have any more emails to write or read, there’s not a lot else to do. Especially before people get comfortable with what wave is good at, you’re not going to have a ton of new waves. I, however, have had plenty to do in wave recently. Partly because I’ve been trying to find almost any excuse to use it so I could see what it was good at. This meant people replied to me there and some stuff wasn’t so good, but mostly nothing was amazingly worse in wave than whatever other tool we’d've been using for that interaction else wise.

So Wave Is Perfect?

No. In fact, I’ve found something that it’s pretty bad at or at least very awkward at: random chatting. If I IM a friend across the country to see how he’s doing and our conversation wanders in topic, I feel like wave is sort of too much structure. On the one hand, it’s nice to be able to manage threading as topics shift and change (if I post a tangent, we can basically split the conversation thread there). On the other hand, it’s kind of a pain to have to manage threading as topics shift and change. When we switch topics, do I want a new wave? Not really. I’m just not sure what to do with that kind of thing. Maybe it’s a matter of discovering the right work-flow, but maybe not.

Relatedly, since Google has taken the liberty of linking my gmail/gchat/gcal/etc. account with my wave account, it would be nice to be able to take a gmail thread or a gchat exchange and import it into wave for further editing. This is especially when I’m in a random chat and the topic shifts to some project we’ve been collaborating on. I assume this is something that’s on the horizon, but as I’ve been using wave pretty regularly, I’d get a lot of mileage out of it now.

I also think there are some things wave is or will be good at that no one’s discovered yet. I think it has huge potential and I’d like to warn people off of giving up on it too early. Like so many things that are super valuable to know how to use and can change the way you work (or work/play) for the better, it’ll take some getting used to, some learning and some exploration.

Bad & Getting Away With It

Posted on April 30th, 2009 by benhamill | No Comments »

There’s been tons of hoopla about these slides that some guy showed at GoGaRuCo . Seriously, so much hoopla that I’ve been unable to absorb the guy’s name (note: I have a really, really hard time with names as it is, so…). Also so much hoopla that I don’t even really know what to link to so that people will have an idea of what I’m talking about if they don’t already. I guess _why did a decent job of explaining it by not explaining it. The short story is that there were some slides in a presentation with very scantily clad ladies doing very suggestive things. Everyone’s freakin’ blogging about it and I hate to me-too this thing, but I do want to express a thought I haven’t seen yet and I also neglected to make a post this month, which has been bugging me.

And Now, a Tangent

So in college, I played trombone in the marching band. It was good times and we had this principle that we called The Stupid. This may not make perfect sense to people who haven’t experienced band social dynamics first hand, but I’m going to try. Basically, the trombone section had a reputation amongst the rest of the band (360ish total members) for doing ridiculous, stupid things for no reason. It had been decided amongst ourselves that, rather than try to live this down, we’d just run with it. So we did Stupid things on purpose; frequently to humorous effect. I mean–we were always entertained, others were only sometimes entertained.

That was the big flashy visible part of the Stupid. We got elaborate, spending large percentages of our meager college student incomes on Stupid ideas that we planned for weeks. We went to great lengths. The part of the Stupid that wasn’t so visible was the great lengths we went to to ensure that we didn’t… inflict the Stupid on anyone who didn’t opt in. We had the goal of making so that if you missed some prank (or whatever you want to call it, not all of it was traditional pranks) of ours by a few hours, you’d never know it happened. We had varying levels of success with it, of course, but I think we did a pretty good job.

We also tried to go to Stupid lengths to be helpful to the band in general; we’d help clean up or take care of something that we saw needed doing rather than just waiting for someone else to do it or reporting it or whatever. I should point out that the directors found the Stupid highly unamusing in the way that I think is probably appropriate for teachers to find the antics of their students. Taking care of things and working hard was sort of our effort to come out net neutral in their minds and not get in hot water.

So the ‘bones weren’t nationwide (well, the Stupid did get on ESPN in the background a couple times and of course we were on TV performing at games, but not for our antics, generally), as Giles says, but we did have a reputation for being bad and (the key to being bad) getting away with it.

The Moral of Our Story

So, as things go in college, people get older and graduate and new folks come in, etc. Traditions shift and change. There came a day when some new kid was really jazzed up about the flashy, visible, bad part of The Stupid and didn’t have the working-hard, cleaning-up-after-yourself, help-others-out part of the Stupid down so good. Basically, he was seeing the bad and didn’t see what let us get away with it. And he (I’m actually talking about several people over a period of time and series of events) did something he thought was Stupid, but was just stupid. He got on people’s nerves, got in people’s way, maybe he broke something that cost money… and he didn’t do anything that would make people think, “Well, that’s alright, because… whatever.”

So I hope you see where I’m going by now. Amongst Railsers (as a broad generalization and as distinct from Rubyists) there’s a bit of a tradition of being bad. DHH is, arguably, the originator of that attitude and he’s certainly been an icon of it. I’m not even saying he’s wrong. I’m saying that whenever you have people like him (and he is, I should stress, not alone, here, Cf. Chad Fowler, Giles Bowkett and Zed Shaw) there will be others who look up to that way of being, who idolize it, who imitate it, but who, ultimately, don’t get it.

These freshman, as it were, will do the flashy, visible, bad part of the image (perhaps poorly, but perhaps not) but neglect to do the more subtle things that let their idols get away with it. I’m not sure what it is those idols are doing, specifically, that makes up for their behavior (they certainly aren’t practicing their music the most). I suspect that, really, everyone has to find their own way to make up for acting like a jerk.

What I’m driving at is that if you’re setting an example (as anyone highly visible in a community is) for being so awesome that no one minds when you’re a jerk, you have to take a bit of responsibility when others imitate you and screw it up. I think Matz chose (probably by nature, rather than consciously) an easier path: If you set an example of being humble and nice and people imitate you and fail, they’ll at least have the safety net of, “…well, his intentions were good.”

OtherInbox Is For Email From Computers

Posted on December 23rd, 2008 by benhamill | No Comments »

So I use this great thing called OtherInbox. They’re in closed beta just now, but if you follow them on Twitter you’re likely to see when they hand out another round of invites (which they recently tweeted would be coming early in January, if I remember right). Let me tell you a bit about OI before I go into my rant. Hopefully it will segue nicely.

OtherInbox is an email, uh… application. Like Gmail or Hotmail, sort of. When you sign up for OI, though, you don’t get _username_@otherinbox.com, you get a whole subdomain and infinite email addresses at it. So, _whateveryouwant_@_username_.otherinbox.com. Then, when you login to your account, you’re presented with folders based on the email address that the email came to. It’s sort of like filters in other email clients, except you don’t have to set them up, you just hand out a new email address. So if I sign up for a new site, I hand it _sitename_@_username_.otherinbox.com and when they send me email, it automatically goes to a folder in my OI named after that site. So I have an Amazon folder and a Twitter folder, etc. etc.

You can also have a vanity URL and edit your MX records on the host so that email gets routed to OI’s servers, so that you don’t have to use the long _username_.otherinbox.com in your emails. So I have benhamill.com set up that way. Very, very nice feature, that.

Okay, so why might you want this service? Well, spam, firstly. If I’ve only ever given a certain email address away to amazon.com and I start getting spam to that address, I know who the culprit is. Also, if I want to sign up for something that I expect to get spam from, I can do so without fear. After getting that confirmation email, I can just hit the “Block All” button and OI will just not show me those messages. I don’t have to worry about it ever again.

Another use case which I’m loving is when you sign up for what’s called bacn; stuff you want, but not, you know, right now. I use OI to sign up for email lists and such that I don’t want cluttering up my inbox. Stuff I might want to read, but over the weekend or whatever; stuff that’s not time-sensitive.

Which leads me to my rant. If you’re not an OtherInbox user, the following might not make a lot of sense, so you might want to skip it until you are. And I highly recommend you become one. I found that the more I used it, the more I liked it. So, rant on…

OtherInbox is not your primary inbox. It’s right there in the name. I was confused about this at first, too, but it should be obvious. You don’t ditch gmail for OI. You use them both. How you divide it up is something people do differently, but here’s my rule of thumb: If it is sent by a computer (as opposed to a human), it goes to OI. What this does (ideally, since I haven’t finished converting all my accounts over to OI addresses) is makes it such that the only emails that show up in my gmail account are ones that are actually to me.

I mean–how many emails do you get from computers? If you’re like me then a lot. I get email every time someone follows me on Twitter and every time someone sends me a message in my online Diplomacy game and every month when Rock Band sends out their “zine”. Why not have a computer help me deal with it all? It’s not going to read it for me, of course, but it _will_ help me process them. If I know I ordered something from Amazon, then I will look at new emails to my amazon address when they show up. Otherwise, I’ll probably ignore it.

However, OI is pretty bad at displaying conversations. I mean–that’s not a fault, that’s not part of their core mission. They’ve been talking about adding a feature like that since it makes sense for mailing lists, but for personal email, gmail is still king. Tags and search and conversation view, etc. That’s what gmail is good at. OI is good at sorting spam and bacn.

People who talk about having their friends each email an OI address based on their name just confuse me. Your friends aren’t going to sell your email address to spammers or send you stuff you don’t want to read (or, if they are, get new friends… elderly relatives, on the other hand, who will send you random jokes might warrant an OI address), so there’s no need to hide you *real* email address. If you want, you can set up auto-forwarding for an OI address, but just hand that out to real people like you would your real address.

It can get sort of heady, making up any old address to give to people, but if you’re handing out OI addresses to real people, you’re sort of defeating the purpose of OtherInbox. Either you’re using OI’s interface, which is optimized for dealing with emails en mass, or you’re having to set up a bunch of auto-forwards to your primary inbox (with the nice interface for dealing with individual emails). OI is supposed to make it so you don’t have to set up filters or auto-forwards all the time.

I really love OtherInbox. If you’re not a user (and you didn’t skip the rant), really go follow them on Twitter and get an invite code. Or find someone who’s in the beta now and see if they have any invites left (I have a single one as of this writing). I didn’t think I was really an awesome candidate for an OI user, but that’s only because I didn’t realize how much email I get from computers. It’s really freeing to be able to click “Yes, send me updates” on everything. If you never get anything from them that’s worth your time, you never waste any time on it. Throwing away that email address it completely trivial. The real trick to having OtherInbox improve your life is not swimming against the stream, though. So remember my rant when you sign up.