Exercism Raindrops in Python

I’ve been learning a bit of Python this Fall to facilitate conversations with a mentee. In this post, I’m going to share the first Python function I’ve ever written, a solution to the Exercism challenge ‘Raindrops’. Is this good Python code? I don’t know; that’s why I’m posting it here. I’ve read $ python3 -c 'import this' yet am still gloriously ignorant. Below I’ll share the problem, my solution, and a code self-review via praise and criticism. ...

December 6, 2020

Essays on Programming I Think About a Lot

Programming is a new and abstract field, and so we place great emphasis on ideas. When I find one that sticks with me, I end up sharing it again and again. These are some of my favorites. Jeff Atwood, The First Rule of Programming: It’s Always Your Fault. I like to answer questions on Stack Overflow, and a decent number of questions on that website have a title like “I Found a Bug in React”, and a question that starts with: “I’m brand new to React.” It’s human to assume there’s a problem with your tools. Especially starting out, it’s more profitable to assume an issue in your code, because your code hasn’t stood up to anything close to the scrutiny of a popular software project. ...

October 29, 2020

You Have New Mail

Here’s a familiar scenario: you open a new terminal, and before the prompt appears, you see the following. You have new mail. What’s going on here? Explanation Events in your operating system can send messages to your mail queue. Although it’s tempting to ignore them because they aren’t colored red or filled with hyperbolic language, you should not ignore these messages. In many cases, your operating system is trying to tell you something important. ...

October 16, 2020

Technologist Reading List

Here’s my list of favorite programming books. It’s been said that most programmers read less than one professional book per year. I get it. Books about programming can be have short shelf lives, as well as be expensive, hard to find, and challenging to read. But in my experience, great programmers have read a lot of them anyway. There are concepts defined in classic programming books that are ubiquitous in the field. When you read those books yourself, you absorb those concepts. Or at least develop informed critiques of them. ...

September 28, 2019

The Universal Programming Language

Recently I tried to answer a question that I think is common to consider when you’re first learning about computer programming. I’ll paraphrase: Why can’t there be an “universal” programming language that serves all purposes? The number of programming languages in the world is dizzying. Names like JavaScript, Ruby, and C are known by programmers and non-programmers alike. Since technology constantly evolves, and learning many things takes more time than learning one thing, wouldn’t a reasonable expectation be that we’ll all someday coalesce around an ideal language, that’s perfect for every situation? ...

September 17, 2017

"It's done"

As soon as you can, just do the thing you have to do, and respond with: “It’s done.” When a stakeholder asks for a change to the software I’m building, my typical responses are, in order: “Got it.” Then: “I’m working on that issue.” Finally: “It’s done.” Here’s an alternative: skip the first two conversations and go straight to the third. Ship, then signal. Underpromise; overdeliver It’s a variation on the idea of “Underpromise; overdeliver.” In this case, by waiting to respond, I’m promising nothing, the most under of underpromises. And I over-deliver by shipping when the stakeholder is least expecting it. ...

July 19, 2017

The N + 1 Problem

Recently, I was thinking about the N + 1 problem. N + 1 is a performance issue in a web application, where a method call unleashes a torrent of database queries. Take this method, which loads all users: def index @users = User.all end Simple enough, but call some records in the view associated with each user, such as ‘friends’ and ‘reviews’, and Rails builds a SQL query for each user, each user’s friends, and each user’s reviews. This is redundant, and with a big database, unacceptably slow. This is an N + 1 problem. ...

February 22, 2015

The Case for One Computer Monitor

I have one computer monitor on my desk. Not long ago, this was common, but today, many people have two, three, or four monitors. In this post, I’d like to make the case that most professional programmers can use just one monitor. Disclaimer Hardware is a personal preference, and you can use any configuration you like. Some people may need more than one monitor for physical reasons. Some people may have jobs where secondary or tertiary displays perform a crucial function. I’m sure there are valid exceptions here. ...

March 31, 2014