September 23, 2009

Pass the Duct Tape

Reading The Duct Tape Programmer really hit a nerve with me. If you code for a living (or part of your living), go read it. I sometimes get annoyed by Joel Spolsky's writing, but this time he hit the nail right on the head.

I am by no means putting myself in the same league as Jamie Zawinski, but I definitely subscribe to the idea that keeping my code as simple as possible is going to pay big, big dividends in the long run.

Needless complexity really does kill you.

In my work it has manifested itself in a few ways. But one that seems to pop up over and over in recent times (and has bitten a few of my coworkers as well) is socket programming. For whatever reason, we're able to find the the freely available client libraries for interacting with some services will inevitably fail a small but non-zero percentage of the time. And when you're making millions and millions of calls or connections per day, even a 0.01% failure rate is enought to make for a really bad day.

That's especially true when the failure mode involves leaking file descriptors or needlessly long timeouts (or timeouts that fail to work properly) that result in a full or partial cascading failure. It's the ultimate in frustration.

I'm not going to name names here. Maybe at an upcoming conference I'll talk about what we've seen and how network oddities add a whole new set of failures to the mix.

Anyway, the solution ends up being one of two options: (1) forking the module and re-writing the code to use the low-level system calls instead of the multitude of abstraction layers that were supposed to make the task easier (die abstraction layer! die!), or (2) scraping the module entirely and writing your own. The first option sucks but at least you're not having to learn all the quirks of those abstraction layers. The second option sucks even more but at least you know exactly what you've got when it's all said and done.

For me it's more satisfying and productive get to know the low-level stuff well enough that you can just drop it in when you need it. It's less frustrating than trying to reproduce all the conditions and variable that cause some abstraction layer to fail.

Pass the duct tape. I've got work to do!

Posted by jzawodn at 08:40 PM

September 22, 2009

Watching Yahoo's Transformation

Having not worked at Yahoo in a bit over a year, it's interesting, amusing, and frustrating to watch what's going on over there. Some of their moves confirm feelings I've had for some time, while others are more puzzling.

The Search deal with Microsoft was basically inevitable. You could see even two years ago how out-gunned Yahoo was compared to Google and to what Microsoft was rumored to be thinking of doing. Based on what I knew, Yahoo was spending less than 20% of the money on search that Google was and they were trying to do the same worth with about 1/10th the hardware and less mature infrastructure software. Meanwhile, the web kept growing and became more and more real-time.

It seems that Yahoo wants to sell Zimbra. I remember when that acquisition happened. I thought it was cool technology and would be great if we actually wanted to compete in the on-line "office suite" market (or whatever), but that never happened. Instead it remained as one of those "enterprise" products that Yahoo has a history of trying and failing at. Remember Yahoo's enterprise instant messaging product? FAIL.

Now comes news that Yahoo wants to sell Small Business which includes their web hosting and domain registration businesses. This makes good sense to me. While it's a business that I think has usually made money, it simply wasn't competitive in a day and age when you can get a full virtual machine, storage, and bandwidth from any number of vendors who aren't scared to offer good remote access (ssh anyone?) to the server: Slicehost, Rackspace, Server Beach, Amazon, and so many others. Yahoo's offering may have made sense back in the year 2000 or so when it really competed on price, but this is one of those race-to-the-bottom commodity business and has been for years.

People picking on Carol for selling some stock recently? Well that's just dumb. Yahoo is a public company and she really didn't sell that much.

I hope that Carol is able to trim the parts of Yahoo that no longer make sense and help bring some focus to the company. I really do. But to be honest, I've seen it before. Terry Semel tried to do something similar when he came on board. But that was a wandering effort that ultimate lacked focus and wasn't ambitious or forward-thinking enough.

Jerry and Sue tried this when Terry left, but I really think they were too "Yahoo" to transform Yahoo into what it needs to be.

I see how Carol is trying to be smart on the business side, but I'm not sure how Yahoo plans to wow its users. And coming from the Yahoo! Developer Network, I wonder if Yahoo will ever get serious about outside developers. Conferences and Hack Days are great, but I suspect they still haven't figured out how to offer buisness-class APIs (with an exchange of money and an SLA). Aside from YUI and Hadoop, can you really go beyond a prototype with this stuff?

It could simply be that I never really drank the YOS/YAP kool-aid and never will get it.

Oh, and what about those smaller startups? Should I start to worry that or Flickr is going to go away? What about Upcoming? When their founders start to worry, I feel like I should too. At least Flickr has a business model and appears to still be kicking some ass. MyBlogLog has all but died on the vine, right? Is there anyone left of the original team of 5 or 6 engineers still working on it? No, I think it fell victim to Yahoo's larger social strategy. FAIL.

I hope that Carol can be clear, focused, and agressive in re-shaping Yahoo. The half-measures attempted over the last few years simply haven't been enough and never will be.

Posted by jzawodn at 07:06 AM

September 20, 2009

How my netbook taught me to love xmonad

I've had this low-level urge to try a new window manager for a few months now. I work on a Linux box (Ubuntu) daily and mostly run a number of terminals, GNU Emacs, Mozilla Firefox, and Google Chrome. Nothing too fancy, really. Oh, and a shitty VPN client.


Most of the time I'm doing this in front of a 24" (or larger) monitor running at 1920x1200, so there's a lot of screen real estate. Yet I was always annoyed by how much time I spent moving windows around or trying to find the optimal layout--always reaching for the mouse.

Years ago when 1024x768 was the norm, I ran a heavily customized fvwm2 and enjoyed it. But then I made the move to Windows for a few years and came back to Linux with Ubuntu/Gnome as my "desktop."

The Netbook

Months ago I wrote about how I love my Samsung NC10. When I'm not at my desk, I'll often use PuTTY to login, resume my screen session(s), and continue working. For what it's worth, I find that the free DejaVu Fonts (specifically the Monospaced one) works exceptionally well.

What I realized is that my method of having one terminal in full-screen mode on each "desktop" (thanks to the VirtualWin virtual desktop manager) is surprisingly productive, even on the little 10" screen. At first I considered this a fluke and attributed it mainly to the novelty of working this way. But after a while I realized that it was the focus that this setup enforces. There simply isn't enough room to have a browser on screen to distract me while I'm coding something, reading email, etc.

I really need to focus one or a few tightly realted tasks. The cognitive overload of having the whole Internet available really gets pushed off-screen and mostly out of mind.

Trying xmonad

After a discussion in our chatroom at work the other day, I finally decided to give a new window manger a try: xmonad. A big help was Tom's Introduction to the xmonad Tiling Window Manager which gave me just the information I needed to get started.

I used it most of Friday and a bit off and on Saturday, both on my primary work computer and my "home" Linux desktop machine. The experience has been surprisingly positive so far. Most of the hassles have revolved around re-training my hands to learn some new keyboard shortcuts and finding replacements for the few GUI things that Gnome provided on my previous desktop.

On thing I particularly like is that most of the keybindings seem very sane out of the box with xmonad. I haven't really needed to customize anything yet. I have found that a couple keystrokes that I use in GNU Emacs appear to be intercepted by xmonad and I haven't found an easy way to undo that or at least discover what they're supposed to do: Alt-w and Alt-q are the two I've noticed.

I also needed to resurrect an old xmodmap file that I could use to turn my CAPS LOCK into a Control key and re-discover the right xset command to set my key repeat rate higher than the default: xset r rate 250 30.

Other than those few nits, it's been pretty smooth sailing. I definitely feel like I'll be more productive in the long run a result of switching.

Have you tried a tiling window manager? Did you stick with it?

Posted by jzawodn at 09:25 AM