The Iterate-and-Mutate Programming Anti-Pattern

Take a look at this small, typical code snippet: I call this the iterate-and-mutate pattern. It comes up all the time in code. But every time we see it, we should think about replacing it with a mapping operation, like this: (Ruby syntax) This code is “safer from bugs, easier to understand, and more ready…More

Elixir can be a lot easier to learn than Python

I stumbled on a surprising instance of Elixir being much easier to learn and use than Python: I was in each one’s REPL, comparing how to do some typical programming task. (I forget exactly, but it might have been JSON parsing.) The function in each language was easy to call. And in Elixir, the REPL…More

Ruby RSpec or Minitest on new projects?

I’ve used both for years. But I use RSpec on my new projects: RSpec is an application, but Minitest is only a library. This cannot be overstated. RSpec has libraries too, of course, but the user experience is via a mature CLI program. (Bisect is wicked, and a life-saver!) It has incredibly useful options and…More