The Vault

A friend of mine, a contractor, recently came to me with a strange problem. He did an excellent job renovating my apartment, and since then he got used to me delousing his Windows computer and coming up with creative googled-up solutions for just about anything. This one has me stumped though.

Right now he is demolishing a location, previously occupied by a bank. It has a vault door in it that my friend needs to cart away.

He wants to sell it. I mean, the thing looks valuable – but I have no idea of who would want something like that. Movie people? A restaurant? Eric Sink (his company has a product called Vault and he must be flush after Microsoft buying a chunk of his stuff). I wonder what would happen if we did place it on eBay. Well, in fact there are a few of them there, and people don’t seem to be buying.

Semi-literate Programming

I recently finished “Coders at Work“, a series of interviews with famous programmers.

On one hand, reading a book like this is a downer: it’s very clear to me that I occupy a place that is very close to the median of the bell curve, and the skill level of programmers is a very steep non-linear curve in itself. I’ll never be as good as JWZ or Brad Fitzpatrick. But I knew that before, and I am ok with it. On the other hand, this book inspired me to read more code.

The programmers in the book disagree on many points, but they mostly agree on the importance of writing readable code and educating yourself by reading other people’s code. I make my living writing in scripting languages, and I haven’t written a line of C or C++ since college. But there’s nothing preventing me from downloading and taking a look at the source of Apache, PHP, MySQL.

It’s important for me to understand “how the sausage is made” in the PHP stack, and as it turns out, what happens between Apache PHP and MySQL in term of requests and timeouts is not as simple as one might think. I asked at StackOverflow about this, but all the diagrams that people pointed me at were of the very rudimentary type: “look, here’s a happy cow, it goes to Bovine University, look – it’s all shrink wrapped on the supermarket shelf” instead of “sausage farm/slaughterhouse/truck/factory tour, starting with cow insemenation”.

When I downloaded the source code of mod_rewrite, arguably the most useful Apache module in the world, I was amazed to find out that it’s only 5000 lines of C with comments.

The book ends with the interview of Donald Knuth, and another two major questions that the interviewer is asking everyone is – “have you read Knuth’s books and have you tried literate programming”. It was interesting to find out that most of the famous programmers use Knuth’s the same way that I do. The books sit on my bookshelf, I look at them, I sometimes try to read them, I skip most of the math. They serve as a constant reminder to me that I suck at computer science even more than I suck at programming, and luckily there are people out there who know all of this stuff who are not idiots like me.

Here’s a photo of my cubicle at TV Guide circa 2002, Knuth’s books are holding a place of honor next to the mini fridge. By the way, taking pictures of the places where you work and live is something that you should not forget to do: years from now nobody will care about those pictures of flowers, shadows, and sunsets, but

I’ve read the book about Literate Programming at the time, and was rather inspired by it. Ok, maybe I didn’t read it and more like skimmed it. I don’t think I understood what real literate programming is.

The way I understand it, Literate Programming is a way to write programs as a narrative that is readable to computers and humans. My father, in his former career a site supervisor (a type of a contractor) is very fond of giving very detailed instructions to me, the same way he used to give instructions to construction workers. His instructions usually are exaustive algorithms, with error handling. I think that his instructions, expressed as a flow of conciousness, would work not only on me and construction workers, but on computers as well, and are similar to what Donald Knuth has in mind. All you really have to do is to build a layer of abstraction between these instructions and a computer language. Also, since computers don’t forget things, he would only need to repeat his instructions once.

These days my dad is a COBOL programmer. Everybody dumps on COBOL, but in my mind it’s a language worth of a lot of respect. It has a syntax that is very English-like, something that makes reading COBOL code easy. Well, maybe it’s like reading some old-timer’s newsgroup post written in all caps, but it’s still much closer to English than most other computer languages.

At the time I was reading “Literate Programming” I was using ASP 3.0, IIS, and SQL Server 97. My task was to write a system that would account for booked and pending business. This is something that had to be done since the age of Mad Men. You see, the dealings of clients, account executives (like Pete Cambell), their bosses, account coordinators, creative department, etc are rather convoluted. But in the end, to get paid, you have to have a system that will track who brought in what business, who handled what, and how the commissions need to be split.

This is normally the realm of something called EAS (Enterprise Application Software). Back at the turn of the century, this area was still dominated by a company called SAP, but there were a few smaller players, like Salesforce.com that tried to package these applications. Any sane IT manager looks to see if an EAS solution can be purchased first. It turned out that TV Guide’s buseness logic was impossible to shoehorn into any existing solution. SAP folks said – yeah, no problem, we’ll build you what you want, but our prices start at $1M, and then there are consultant fees. ERM world is a crazy place, you can read about some true craziness in “Cube Farm”, an account of one hapless developer’s adventures at Lawson Software. It’s a truly riveting book, and I fell that every developer out there should read it. It’s literally Lovecraftian in nature, that book.

In any case, it fell to me to develop the application from scratch. Inspired by Knuth, I decided to write some semi-literate code. Me and a project manager, Brad, went to the clients and interviewed them at length, documenting their existing process (aka the most complicated set of spreadsheets you’ve ever seen). In the past, before cheap computers, all you needed was a Joan Holloway, but I believe they stopped making them.

Brad went on to go back and forth with a very terse document about 5 pages in length that described how the new system would work. He would sit down with the clients and go through the narrative, step by step, confirming that this is what they wanted. Meanwhile I created an object oriented library that made dealing with the database, creating forms and navigation elements much easier. This is similar to to what you might find in a CMS like Drupal, only a little cruder.

When the document shaped up, I created the database schema, and then I took a big chunk of the document and pasted it into one huge comment block. I proceeded to break off chunks of that block and writing the code around it. Interestingly enough, as time went on, the project manager started helping me to write the code: enough of scary database abstration was hidden by simple classes and method, and there were tons of self-evident examples all around to copy and paste. I switched to writing reports that involved cubes, rollups and other fancy stuff. Stored procedures that did the reports also received comments from the document that described the reports.

This wasn’t a monolythic system – I was writing it for 2 years or so, releasing a chunk after chunk. In the end it was handed off to another developer, the whole transfer took only a couple of hours. There weren’t any major bugs, maintanence issues (I believe I received only one phone call about it after several years of continuous use). All in all I was pretty pleased with this approach and can absolutely recommend it.

I believe this is the reason why so many English majors become excellent programmers: if you can write for people, you can write for computers. Sometimes there are reasons why you can’t do both at the same time, but there’s no reason not to find some middle ground.

Plumbing Chops

In my line of work I am often reminded of this brilliant passage from  Ellen Ullman’s “The Bug” (which I reviewed earlier):

“Programming starts out like it’s going to be architecture–all black
lines on white paper, theoretical and abstract and spatial and
up-in-the-head. Then, right around the time you have to get something
fucking working, it has this nasty tendency to turn into plumbing.


It’s more like you’re hired as a plumber to work in an old house
full of ancient, leaky pipes laid out by some long-gone plumbers who
were even weirder than you are. Most of the time you spend scratching
your head and thinking: Why the fuck did they do that?”

To take the metaphor a little bit further, let me bring up one actual plumbing nightmare that I faced when I was renovating my apartment. One of the contractors clumsily knocked  off a valve on a piece of  water piping that did not have a local shutoff. The only shutoff was in the basement, and required turning off the water for the entire line. And the super, who could do the shutoff  was not in for a couple of days.

Another contractor knew exactly what to do in that case. He created something that he called a “chop” (I found out later that the term is Ukrainian). It’s a conical piece of wood, shaped like a fat pencil that is hammered into the hole in the pipe. In a couple of minutes the wood swells up and completely plugs the leak. Add some duct tape around it, and you got a very good temporary plug that is almost as strong as the unbroken pipe.  It makes the worst permanent solution (wood rots), but the best temporary one (it can be applied without taking the whole system down and is reasonably strong).

Chops, or as they are called in English – thru-hull plugs, are a maritime invention: they are used for emergency repairs on boats. These days you can even buy a ready made set.

People think of software as of something static. Well, dynamic websites are more like a ships out at sea. Sometimes you have to patch them up in a storm. And then a good, strong “chop” is the best you can hope for until you can repair the leak permanently. And you are going to sink unless there’s somebody around who knows how to make a “chop”.

Perfect Workmanship

Perfect workmanship is expensive. Why? Because it means starting over or laboriously fixing tiny little imperfections. Joel Spolsky describes this very nicely in his article about craftsmanship:

“The moral of the story is sometimes fixing a 1% defect takes 500% effort. This is not unique to software, no sirree, now that I’m managing all these construction projects I can tell you that. Last week, finally, our contractor finally put the finishing touches on the new Fog Creek offices. This consisted of installing shiny blue acrylic on the front doors, surrounded by aluminium trim with a screw every 20 cm. If you look closely at the picture, the aluminium trim goes all the way around each door. Where the doors meet, there are two pieces of vertical trim right next to each other. You can’t tell this from the picture, but the screws in the middle strips are almost but not exactly lined up. They are, maybe, 2 millimeters off. The carpenter working on this measured carefully, but he was installing the trim while the doors were on the ground, not mounted in place, and when the doors were mounted, “oops,” it became clear that the screws were not exactly lined up.”

I was recently reading a book by Tracy Kidder called “House”. It’s a great book by the same Tracy Kidder who wrote “The Soul of a New Machine”. “The Soul” is a book about computer architects and builders. “House” is about their counterparts in the business of building houses. In one book Kidder describes the extremely stressful process of designing and building an Eclipse MV/8000 minicomputer. In the other he describes the similarly stressful process of designing and building a Greek Revival house.

Both books read like a work of fiction, but they are absolutely factual, written about real people and real products. It’s very strange to be able to go and look up characters that became so familiar thanks to those two books. Steve Wallach from “The Soul” went on to form his own company, Convex Computer, sold it to HP in 1995 and is now a venture capitalist. You can even look up what he looks like now.

Bill Rawn from “The House” heads a big architectural firm of his own. Going there and seeing the buildings that he’s built after the house in the book is somewhat strange: he feels like a literary character, yet there he is, many years later after the events of the book took place. Souweine House, Amherst, MA is listed in the awards section of the website, but unfortunately there is no photo of it.

Interesting to note that while the Eclipse minicomputers are probably worthless now, the Souvweine House must be worth a tidy sum of money.

While building the Souweine house, the builders made a mistake concerning the frieze, an important architectural element. They go on to fix it, but in order to do it perfectly, they’d have to rip everything out and start anew, which is just like in Joel’s door trim case is prohibitively expensive.

“Jonathan feels sorry for the trouble the frieze caused, but not for the little imperfection it represents. No one else will see it, but Bill has said that even when repaired, the frieze won’t quite reproduce his intentions. Orthodox Jews have a tradition that until the Temple in Jerusalem is rebuilt, they will not erect a house or a building without giving it one deliberate imperfection. Though not a member of the Orhodox branch of Judaism, Johnathan believes in the inevitability of imperfection. So why not celebrate it? “There’s a flaw in the house …,” he says, and flashes a smile, a shooting star of a smile, “… which the pernicious part of me sort of likes.””

By the way, I can’t pass up mentioning my favorite, but apparetly later edited out, quote about Kidder. “For a woman, Tracy really know her stuff and gets into a great amount of hardware detail”. What do you think the source for it is?

Ukraininian Sushi

Spyware and construction contractors are very bad for my health. For instance, recently, the contractor who renovated my apartment asked for my help with cleaning out yet another spyware infestation. To express his gratitude he gave me a present that his sister brought with her from her trip to Ukraine. A piece of genuine Ukrainian salo.

Salo is an Eastern European staple that for some strange reason is virtually unknown in the West. Wikipedia describes it as salted slabs of pork underskin fat. It’s not really bacon – salo mostly consist of unrendered fat (bacon has more meat) and can be eaten raw.

If you’ve never had salo, it’s most similar to the taste and texture of little pieces of fat found in some harder kielbasas. In its fried form salo resembles bacon and pork rinds, except it’s much tastier. Also, you really can’t make exceptional borscht or fried sunflower seeds without high quality salo.

Here’s a piece (Ukr. “shmatok”) of salo on my official Jamie Oliver cutting board. I used my sashimi knife to cut it into thin slices – the best way to eat, in my opinion.

It’s kind of hard to describe the taste and texture of Ukrainian salo. The texture of it is hard, yet it melts on your tongue. It’s salty, fatty, garlicky. Your caveman instincts make your brain fire “wow, inhale this right now” messages, yet the little Surgeon General in your head tells you “wow, this will clog up your arteries good.” They don’t call salo “Ukrainian cocaine” for nothing.

The little Surgeon General in your head is wrong, though. Having come into possession of this authentic salo for the first time in years, I just had to kick it up a notch and make the _ultimate_ in unhealthy treif food. I had to make the legendary confection – “salo in chocolate”.

This confection started as a joke playing on Ukrainians’ fondness of salo. Then some Russian and Ukrainian restaurants started making it as an exotic delicacy. Then someone started to make a candy bar of that name. The Wikipedia article has more on that.

I tempered some good semi-bitter chocolate and dipped thin slices of salo into it.

The flavor is outstanding. Chocolate goes well with salty, fatty salo. It tastes as good as it is unhealthy. Overall, though, the quantity that I made is probably no worse than a movie theater popcorn or the bun of death from the vending machine at work. In fact, probably healthier.

If you are curious, you can find salo in most Russian food stores in New York. It will probably be lower quality Canadian salo, but it will give you a pretty good idea.

You can find more of my gastronomic adventures here.

On My Way To The Subway

The Joel writes:
“New York is the kind of place where ten things happen to you every day on the way to the subway that would have qualified as interesting dinner conversation in Bloomington, Indiana, and you don’t pay them any notice.”

The same exact day I realized just how true that is. Let’s take my illustrated walk to the subway that is pretty typical of what I do to clear my head :

As I was taking this picture of people backlit by a sunset, a was shoved with a great deal of force. From the following stream of obscenity I understood that I inadvertently pushed (or more likely just simply got in the way of) an “apology enforcer”, and the shove that I got was my punishment for not apologizing.

Apology enforcers are this tiny subset of New Yorkers who will berate you for any tiny little bump that you might give them in the most crowded streets, subway cars and platforms. They will demand an apology even if you didn’t feel the bump yourself or even if they bumped into you. The crazier ones will return the bump back, taking it almost to the level of assault and curse you in the process. The only way to deal with them is to apologize and not try to argue your case. This does not always work, as the craziest of them will follow you, delivering an obscenity laced sermon on the importance of saying “excuse me” and “sorry”. Try to get away as quick as possible from them.

Walking down 8th I came into a White Castle to buy a diet soda. I prefer fountain soda to canned stuff. Most of the patrons took some time to study two wanted posters documenting the great White Castle rug capers of ’05.

The guy on the right kind of looks like Monzy a little bit (it’s not him though).

These thefts reminded me of all the stuff (including a webcam) that was stolen from DNA Lounge over the years. This also reminded me that the best way for hotels to stop towel theft is to use non-logoed towels. Stealing stuff without logos is just not as fun.

A little further down 8th I saw an elderly guy sitting on the stairs leading down to the subway. The guy was breathing heavily and holding his chest. “I really, really hope so” is not a good answer to the standard “Are you Ok?” from a gray haired gentleman, with a forehead overflowing with sweat on a cool summer evening, staggering to get up and sitting down again and strangely not emitting any alcohol vapors. I called 911, described the situation to the dispatcher and waited for a “radio car” to show up (it took about two minutes). The cops talked to the old dude, who happened to be a tourist from one of the Carolinas, and quickly called him a “bus“.

Meanwhile, I noticed another thing about NYPD uniforms – there is a little bar over the pocket that indicates in Roman numerals the previous round anniversary of the cop’s service. The guy responding to my call was a 10+ year veteran, the other cop was a rookie.

When I made it to West 4th the old school clock on the top of a building was showing time in those alien characters from Predator.

My good deed for the day done, I walked further. Guess what – there are fireflies on lawns in Manhattan too.

I reached 34th street and once again stopped to appreciate “Radiant Site” – and art piece by Michele Oka Doner. I like it, the hand made gold tiles are all different and look very good. But then again, I can’t stop myself from thinking that this is not really art, but something that any contractor with a good tile supplier could accomplish.

Down on the platform instead of a regular train I was met by the cool Mantis crane car.

P.S. Dang, that Starbucks logo is everywhere. It’s in two photos in this post.