« Ugly bags of mostly bacteria | Main | You've come a long way, baby »

Amusing yourself at work

In this bad attitude How to survive maintenance programming thread on Perlmonks, I was greatly impressed by this tale of stealthy geek auto-amusement.

If you have a suspicious supervisor, sometimes you have to introduce the complications in more subtle ways.

I once used to do work on an invoicing system for people selling cars; the program’s job was to take an invoice template and fill it in. Naturally the template language could only be interesting if it were Turing-complete, but with suspicious minds around me I had to go for a two-pronged attack - get two different customers to request two different features, one of which required an optional line (“skip the following line if this value is zero”) and the other of which required a dynamically-selected continuation template.

Once I had those two in place I had control flow, and shortly thereafter I had the vehicle-invoicing prime number generator: about 300 lines across 7 templates.

Ah, happy days. :)

If a programming language is Turing Complete, it can be used to solve any problem that any computer can solve. One of the surprising results of computer science is the bar for this is very low.

Comments

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)