Month: January 2011

  • Tattoos for web developers

    Please help me to compile a list of ideas for web developer-appropriate tattoos. Here are some to get you started:

    1) “It works on my machine”
    2) “Have you flushed the browser cache?”

  • Kintsugi: Beautiful Repair

    The legend goes like this: a Japanese shogun broke his favorite Chinese tea bowl, and sent it back to the same artisans who made it for repair. The bowl came back properly repaired with glue and metal staples. The shogun could not believe his eyes: ugly staples connecting delicate pieces of porcelain – surely that was not the right way to do it. In response Japanese artisans invented kintsugi: a technique of repairing broken pottery with special gold-containing laquer resin. Pieces repaired in that way became even more beautiful and valuable than when they were whole. After seeing a few repaired pieces in museums I have no doubdt that the story about wealthy Japanese breaking their favorite tea bowls on purpose just to have them repaired is true.

    These two bowls were on display in a museum somewhere in Washington.

    kintsugi-museum-1

    kintsugi-museum-2

    I recently purchased this Karatsu tea bowl. It was excavated from an old kiln and is estimated to be of the 1570-1620 vintage. It was repaired by a modern craftsman using a similar technique called doutsugi which uses a gold-copper alloy. It cost me about $180. Is it authentic? Probably – the dealer seems to be reasonably reputable. I’ll greatly enjoy drinking tea out of it.

    This (as it’s often the case) made me think of my own craft. A huge part of my job is putting software Humpty Dumpties back together. Is any of my work this elegant? Of course not, but I can think of some examples. Apache – or “a patchy” comes to mind. It’s a beautiful piece of code glued together with other beautiful pieces of code. Then there’s Pressflow – a fork of Drupal that glued it back in many places where the original was cracking.

  • The Claw or Playing Not So Hard

    When I began my career hiring managers still said things like “we work hard, and we play hard”. The “playing hard” usually consisted of drinking tequila shots after work and having either a ping-pong table or an arcade machine or two in the office.

    Free tequila shots were always a crowd pleaser. Not so much with the games. The worst offender was the Packman machine. The silly little tune and “WAKA-WAKA WAKA-WAKA WAKA-WAKA” got old really fast. The ping-pong table was even worse: it’s hard to write code late in the evening in the middle of a death march project while system adminstrators click-clack the celluloid ball for hours. Both were gone quickly.

    The lone “play hard” straggler was the awesome APB arcade machine that was placed near restrooms. “Help, help”, “yeah, yeah” and the awesome mumbling of the commanding officer deeply etched in our collective brains.

    Besides insidious noise pollution, arcade machines make coders burn out even faster: staring into blinking phosphorus is not good after a long and hard day.

    So, how can a startup stay true to the Silicon Alley/Valley cliche? I think I figured out an answer. A claw machine otherwise known as a “skill crane”.

    My co-worker recently got obsessed with an obscure iphone game called Clawzilla. The original purchase price is a bit steep, but it includes free game tokens. The graphics suck big time, but the remote control functionality and responsiveness is top notch. In theory you can even claim toys caught by you by using a claim code and providing a few bucks for shipping, but that part did not really work for me.

    In any case, me an my co-workers somehow rediscovered that claw machines are awesome. I spotted a toy claw machine at a drugstore and could not resist buying it. I cut the wire to the speaker that blasted circus music, but it’s still a bit noisy (but not as bad as the video makes it sound) because of poor gear alignment. We filled it with memory sticks, a titanium spork, minifigs and other geek items, culminating in a business card of our MIA CTO.

    It’s still kind of lame. Unfortunately there are no affordable “real” mid-size claw machines on eBay: they were only created recently for prizes like the iPod. It’s kind of interesting: there’s a claw machine for iphone, and an iphone for a claw machine. In any case, these small machines can only be found brand new and cost several thousand dollars. Meanwhile, eBay is full of fully functional $500 claw machines.

    Those are great. Load it with old phones, unwanted swag for conferences, etc. Use the proceeds from the quarter slots for charity (be it beer for developers or a real charity), and watch your employees and friends unwind trying to grab that lobster harmonica. It’s a dumping ground for swag accumulating in the drawers as well as a way to refocus and rest your eyes.

    The best part? Have your designer make decal featuring local headcounts and localized title card and decorate your machine with them.

  • Hamon or the Skin Deep Beauty of Code

    The craft of programming is a little depressing: you spend days and nights pushing bits inside a computer, weaving a pattern that will ignite the right pixels on monitors or magnetize the right atoms on disk platters. But it is craft nevertheless, except one where beauty matters very little. Coders create the true ukio-e – floating world, but one that is as ugly as it is fleeting.

    I’ve read a good chunk of Beautiful Code: Leading Programmers Explain How They Think, but I’m still far from understanding what beauty is in code. Ugliness is self-explanatory: if you recoil in horror after reading a few files, it’s ugly. I recoil on the daily basis.

    I’m not talking about the success or usefullness of things that code creates. I am pretty sure that the code that runs plentyoffish.com is as ugly as the website itself, but it does not detract from its success and utility.

    I think the key to my preception of code beauty is related to “hamon”: a concept in Japanese swordmaking. If you’ll look at a Japanese sword, you’ll usually see a wavy pattern near the edge of the blade. Hamon literally means “blade pattern”. It is created when a swordsmith applies special mud to the edge of a in a wavy pattern of varying thickness and composition, and then heats the sword and plunges it into hot water. You can see the process in this video (it starts at about 1:30 mark).

    The primary purpose of this treatment is to create a blade that is very hard and can take a lot of stress, which is a contradiction, as hard steel is very brittle. The edge gets the thinnest coating, and after heating and cooling turns into martensite hard crystals of high carbon steel. The thicker coated back turns into pearlite, which is a softer, but very flexible lower carbon steel. The hamon pattern is formed where these two types of steel interlock. The wavy shape makes the sword able to absorb shock better.

    The absence of or inferior shape of hamon clearly indicates the inferiority of the sword. The aesthetics of it are just a coincidence, but it is also the resason why the craft of the samurai sword endures: collectors and museums purchase them as works of art. I’ve seen many swords in museums, and even though you can’t appreciate them as well as by holding them, the patterns in the hamon are hypnotic.

    Here’s a good video of what hamon looks like in different ligting conditions.

    There are many different styles of hamon, here are some examples from very excellent “The Craft of the Japanese Sword“:

    There are of course many swords out there with fake blade patterns made with acid etch, wire brushing or other abrasives. Fakes are neither beautiful nor strong and easily identifiable.

    When I look at a code listing I also see a wavy pattern. It’s nowhere near as connected to quality as the hamon, but it is still often an indicator of it. Indentation, spacing, length of keywords and function names, the amount of syntactic sugar, overall length of the listing: good code is sometimes beatiful to look at.

    Sublime Text 2, a new programming editor that I am using, has an interesting feature: an insert that shows the whole file in miniature. Here are side by side beginnings of commit.c from (top to bottom) cvs, svn and git. I don’t know if anything can be determined by looking at these pretty skyscrapers of code, but aestetically I like git better.

    This goes a level further – into software architecture. There’s this old chestnut of the maps of system calls in Apache and IIS web servers. You can easily tell which is the product of Redmond craftsmanship.

    I would like to add that wavy patterns are the last things that I look for in code and this whole article is just a fluffy philosophical musing. Yet, maybe there’s something there in those patterns.