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

Making mistakes: Django startproject and Rails new

I like to see how software reacts when I step off the happy path and make a mistake. Today I found this interesting difference with an unknown (or misspelled) command line option: “–derp”: An interesting difference! Personally, Django is reacting like I’d expect. And so for me it’s following the principle of least astonishment. Rails,…More

The Economics of Programming: Externalized vs. Internalized Costs

Many days I feel like my work as an agile consultant is simply internalizing (externalized) costs. First example that comes to mind: software development done too quickly which creates technical debt as it goes. In the short term, a project like that can seem very successful, exceeding expectations for delivery time and customer satisfaction. And then…More

Python vs. Haskell round 2: Making Me a Better Programmer

Another point for Haskell In Round 1 I described the task: find the number of “Titles” in an HTML file. I started with the Python implementation, and wrote this test: Very simple: I had already downloaded the  web page  and so this function had to do just two things: (1) read in the file, and then (2) parse…More