well-typed vignettes

I present to you some well-typed programs along with associated run-time and compile-time errors for pondering the meaning of well-typed. The context was me trying to understand the meaning of the quote “Well-typed programs cannot go wrong”. The exercise was illuminating for me but when I started writing explanations they got a little too philosophical so I’m just going to present the code and the errors. Continue reading

a day in the life of a programmer

The Ideal

You wake up full of ideas about new features and capabilities that can theoretically be added to the product you are working on. Several of these new features generalize existing functionality and get rid of corner cases that have been getting consistently flagged as bugs by users. The features and their underpinnings have been incubating for a while now and you’ve been working on sketches, mock-ups, and prototype code over the last few weekends.

file system as a database

So it turns out that mv is an atomic operation if the source and destination are on the same device. This means that transforming and shuttling data between files can in theory be done in a transactional manner at the cost of some extra space. Here is an example workflow that came up at work: Continue reading

making chroots

Recently I had to build a chroot for CentOS 6.4 and I kept getting RPM DB errors. The errors were because I was building the chroot on a CentOS 7 box. After banging my head against the wall for a while I discovered that once yum is installed in the chroot it is much better to change into the chroot, rebuild the RPM DB to fix the errors, and then install all further packages from within the chroot. The finished chroot can be used as-is or imported into Docker.

broken by design

So it turns out making “broken things” and then “fixing” them by heeding the opinion of some person higher up in the social/corporate hierarchy is nothing new

According to Vasari Pier Soderini (the Mayor of Florence) was standing beneath the statue as it was put into place. The Mayor complained to Michelangelo that the nose was too thick. Michelangelo tricked Soderini by climbing the statue with a chisel and some marble dust concealed in his hand, pretending to work on the nose and sending down a shower of dust, he asked Soderini if it was improved, the Mayor replied “I like it better, you have given it life”.

I wish I could say that this kind of trickery is unnecessary in software but I would be lying.

interview questions (merging hashes)

The motivation for this one is that configuration for various development and production environments is often expressed in some kind of key/value format. Yaml and Json are the popular choices. You can also imagine at some point thinking that you can provide some kind of override mechanism for taking a development configuration and turning it into a production configuration by providing overrides for the keys you want to change in production. I’m not convinced this is a good way of doing things but let’s follow along anyway. Continue reading

kill the technical interview

Update: Patrick McKenzie, Erin Ptacek, and Thomas Ptacek actually have a pretty good way of hacking the problem. I recommend heading their way and signing up for whatever it is they have in the works because there is no way it will be as bad as the usual technical interview process.

I’ve been trying to hack around the technical interview process but so far I’ve been unsuccessful. That’s not to say the experience has not been worthwhile. My ability to discriminate between professional software shops and amateur ones has increased a little bit. Here are the criteria I’ve settled on. Continue reading