Amy M Haddad

Why You Need a Programming Checklist

By: Amy M Haddad

image

It’s a familiar story. The code reads like a cryptic puzzle. The program has lines of “dead” code or contains useless comments. Or changes were made to the code and the tests no longer pass.

We’ve all encountered these challenges or oversights. Maybe we’ve caused them ourselves. But it doesn’t have to be that way. There’s a simple solution that can help: a checklist.

The idea sounds so simple. Beneath us, perhaps. But it's not. That's because we’re human and we’re fallible.

A checklist reminds you to remove the “dead” code and unnecessary comments. It reminds you to think hard about naming: is t a meaningful variable name?

Writing code is hard. There’s a lot to think about. There are many moving parts. Make your programming life a bit easier and use a checklist. It’s quality assurance that your work is complete and accurate.

Prevent the Preventable

I learned the importance of checklists when I began writing professionally and routinely found myself making the same mistakes.

So I made a checklist to document the core steps of my writing process, which I still use today. As I draft an article, including this one, I defer to my checklist. It reminds me of the obvious things I need to do, like add links to any outside sources referenced in the article.

This helps me prevent preventable mistakes, which can be overlooked as I'm writing. A checklist also helps to ensure accuracy and reduce the cognitive load. There’s less stuff I have to keep in my head at a given time.

When I began programming, I also began making checklists (many of them) for the same reasons.

Accuracy...Check

A core reason to use a checklist is to ensure your work is accurate and complete.

Do all of the tests pass? Do your function names clearly and accurately describe what they do? Did you remove the blank lines at the end of the file?

A checklist reigns your attention back and draws attention to the things you overlook in the moment.

It reminds you that the variable name t is meaningless to anyone else who may read your code. It reminds you to tidy up the formatting. It reminds you to remove the “print” statements. It reminds you to run the tests, and make sure they pass.

Preventable Mistakes...Check

A checklist can also help you spot preventable mistakes.

I once opened a pull request (PR) and forgot to add node_modules to a gitignore file. Tons of unnecessary files were added to the PR.

This mistake was easily preventable—if it were on a checklist, which it wasn’t at the time. Now it is.

Of course it makes sense to put node_modules in a gitignore file. It also makes sense to avoid typos. Many things seem so obvious in hindsight, but it’s different when you’re in the moment. That's when the obvious can go right out the window, as it did for me.

Mistakes happen. And they’ll continue to happen. The difference is that a checklist will help you spot them before you hit “submit.”

Reduce the Load

There’s already a lot to think about when you program. Leave some of it to a checklist in order to reduce the cognitive load. This is yet another reason why checklists matter: there’s less to think about.

I’d rather focus my mental energy on the complexity of writing code and rely on my checklist to remind me of some of the more simple—yet still important—tasks, like removing print statements and tidying up the formatting.

Relatedly, a checklist decreases the worry and anxiety that goes along with doing something that’s complex.

For the longest time as a writer, I’d question my work after I submitted it. (Did I remember to do “x”? Do I need to double check “y”?)

The excessive worry began to drive me nuts. Plus, I was wasting precious mental energy. So I created more checklists—small, targeted ones—for the many different writing-related tasks I do.

I already mentioned my writing checklist. But I have several more. I have one specific to editing articles. And another for submitting new articles to freeCodeCamp, a publication that I write for.

These targeted checklists have given me peace of mind. In fact, it’s been liberating.

I have an equal number of programming checklists. They’re also targeted to cover a range of tasks.

For example, I have a problem-solving checklist. Each time I solve a problem, I run through this checklist to ensure the solution is the best it can be. I also have checklists for building out the frontend and backend of an application.

These checklists dramatically cut the unnecessary worry.

Build Solid Habits

So far I’ve written about checklists for the productivity gains they offer. But there’s another reason why I use checklists: to build good habits.

For instance, I wrote a checklist when I was learning about API endpoints. It covered the core steps for writing an endpoint, including:

  • Write in my notebook what the endpoint will do (ie, update the “title” for a particular “post”).
  • Write the SQL query needed by the endpoint and run it in the database.
  • Draw the various responses possible for the endpoint in my notebook.

There were more steps, but you get the idea: I documented the core steps for effectively writing an endpoint before I actually wrote any code. This helped me to really understand what I was doing and why. It also helped me to test my assumptions.

I made far fewer mistakes when I used this checklist. And I ingrained important principles in my mind along the way.

Create Your Checklist

Creating a checklist is very simple: outline the important steps of a process while you do it. As you’re building out the backend of a project, for example, note the key points or the parts where you’re prone to make errors.

I try to keep my checklists to a handful or so of steps. A checklist of five or seven items is manageable and less intimidating, which makes me more apt to use it. Whereas a list of 20 things is overkill. The aim is to hit the core (and obvious) parts of a process.

Then, make your checklist accessible. My variable name checklist hangs on the wall by my desk because I use it all of the time for nearly every programming-related task. Other checklists are saved on my computer. I pull them up as needed.

A checklist is low-hanging fruit. Although it’s not 100% foolproof, it can offer immediate gains. It’s a very simple tool that has a very powerful effect.


← back to all posts