RSSAmplifier

Blog

Tom Moertel's Blog

blog.moertel.comRSS feed ↗10 posts

Latest posts

Comments Are Inevitable

By Tom Moertel Posted on August 14, 2026 Tags: code , comments , beyond clean code , clean code , good code , nature of code , purpose of code , source code , definitions , theory , philosophy , engineering culture ( This post is part of a series of posts on good code . ) One of the arguments floated in the book Clean Code is that “if our programming languages were expressive enough, or if we had…

How I would do the “Bowling Game Kata” in Haskell today

By Tom Moertel Posted on July 30, 2026 Tags: code , comments , clean code , good code , source code , haskell , kata , bowling , tdd ( This post is part of a series of posts on good code . ) Recently, Philip Schwarz from fpilluminated.org wrote to let me know about a new slide deck he had published: The Bowling Game - From Imperative to Functional Programming - Part 1 . In the deck, he revisits…

Beyond “Clean Code”: Why Your Comments Matter

By Tom Moertel Posted on July 27, 2026 Tags: code , comments , beyond clean code , clean code , good code , nature of code , purpose of code , source code , definitions , theory , philosophy , engineering culture ( This post is part of a series of posts on good code . ) I have argued that comments are necessary in good code . My rationale, in short, is that without comments your code’s logic can…

What Makes Good Code Good

By Tom Moertel Posted on July 24, 2026 Tags: code , comments , clean code , good code , nature of code , purpose of code , source code , definitions , theory , philosophy ( This post is part of a series of posts on good code . ) Recall that the purpose of code is to instruct a computing device what to do in a form that is easy for the code’s intended audience to understand and maintain .…

On the Nature and Purpose of Code

By Tom Moertel Posted on July 23, 2026 Tags: code , good code , nature of code , purpose of code , source code , definitions , theory , philosophy ( This post is part of a series of posts on good code . ) Recently, I came across some programming advice that I disagreed with. When I thought about why I disagreed with it, I realized that the argument forming in my head followed from my foundational…

When Google Takeout Fails

By Tom Moertel Posted on August 27, 2025 Tags: google , takeout , backups , data When Google Takeout fails, you’re basically on your own. Here are some quick tips for getting your data when things go wrong. Oh, you tried to download your precious data from a bunch of Google products and days later you got an email with the subject “We couldn’t create a copy of your Google data”? Surely, for…

Sampling with SQL

By Tom Moertel Posted on August 23, 2024 Tags: sampling , sql , probability , poisson process , exponential distribution , statistics Sampling is one of the most powerful tools you can wield to extract meaning from large datasets. It lets you reduce a massive pile of data into a small yet representative dataset that’s fast and easy to use. If you know how to take samples using SQL, the ubiquitous…

Dice Race (part 1)

By Tom Moertel Posted on June 24, 2023 Tags: interview-problems , probability , dice-race In a dice race of degree \(m\) and length \(n\) , each player chooses a sequence of \(m\) die rolls. Then we roll a die \(n\) times to generate the race sequence. The player whose sequence occurs first in the race sequence wins. If no player’s sequence occurs in the race sequence, the race is a tie. (If we…

A Great Old-Timey Game-Programming Hack

By Tom Moertel Posted on December 14, 2013 Tags: assembly , 6809 , games , hacks A long time ago, when I was a college undergrad, I spent some time working on computer video games. This was in the 8-bit PC era, when the gaming hardware was almost impossibly slow by today’s standards. It might not surprise you, then, to learn that game programmers of yore did all sorts of crazy things to make their…

Tricks of the trade: Recursion to Iteration, Part 4: The Trampoline

By Tom Moertel Posted on June 12, 2013 Tags: programming , recursion , iteration , python , recursion-to-iteration series , tail calls , data structures , trampolines This is the fourth article in a series on converting recursive algorithms into iterative algorithms . If you haven’t read the earlier articles first, you may want to do so before continuing. In the first article of our series , we…