Review: Cooking for programmers 0x00

For software developers, Christmas means two things: dealing with bugs that waited until Christmas Day to make themselves known, and receiving gimmicky gifts. This year I was given Cooking for programmers 0x00, a cookbook whose recipes are written in the form of code from seventeen different programming languages. In keeping with the hacker tradition of taking jokes way too seriously, here’s my review.

The recipes

The recipes are for simple dishes such as carrot cake, tomato soup, and crêpes. I decided to try the PHP rice pudding, which involves simmering risotto rice in sweetened milk — I used oat milk — for half an hour. The resulting pudding, served with a dollop of raspberry jam, was a little disappointing. In the UK we tend to make rice pudding with a special high-starch rice variety known as ‘pudding rice’, which gives a creamy consistency, whereas this recipe’s use of risotto rice kept the grains more distinct.

The code

The blurb on the back of the book claims it gives you “the opportunity to get a feeling for programming languages you have not yet used”. Based the on the recipes in languages I have used, this book doesn’t give an good impression of typical code in these languages. The PHP code uses the global keyword and has untyped function signatures, the Typescript code has a huge switch statement turning strings into identical strings when an enum should have been used instead, and the Rust code using string concatenation when the format! macro would have been more readable.

In summary, this book is neither a useful cookbook nor a good overview of how different programming languages approach a similar problem. After forty-five years, the Unix philosophy still applies: do one thing and do it well. And remember: hackers always take jokes too seriously.

Leave a comment