Keeping a journal is great for anyone looking to record their thoughts and experiences but I have also been keeping a programming journal for some months now and I have found it to be a great resource to help me through the day.

I got the idea for a programming journal from my late Granpa. During his retirement years he spent a lot of time learning to code. He kept a number of notebooks where he would scribble notes or code from what he did that day. Sometimes he would even write the code in the notebook in his armchair before taking to his PC the next day to try it out. Sadly these notebooks were thrown out before I could get a hold of them, but I still remember watching him scribble away in his big armchair.

For my journal I've opted to use a plain text file written in Markdown. Pen and paper would be okay for daily reviews, but copying snippets of code and urls is just much easier to do on your computer rather than transferring it to paper.

Choose a journal tool

First we need to choose a journal. Use a tool you're familiar with like Evernote, a plain text file or even pen and paper. Use whatever works best for you.

The reason I would encourage you to use a tool that you're already familiar with is that it will help you make a habit of this. If you want to try something new then feel free to but I think using a tool you're already familiar with makes it much easier to make this a daily habit.

What to journal?

There's several things that I like to keep in my programming journal. The first is the date. It acts as a reference and let's me review my past week or month in terms of work. I would say this is an essential element to your journal. Anything else that follows is optional but I find that a good mix of the following means I don't miss anything.

1. Snippets

There are snippet managers that let you save snippets of code for future use but the one thing I find lacking with these tools is the context in which why I would want to re-use code. Storing the snippet in a journal means that I can provide a background to how I discovered the snippet and any benefits or drawbacks there are to using it.

2. Articles

Bookmarking these in your favourite bookmarking application is good for a reference point, but what did you learn from reading the article. Is this information going to be easy to find in your bookmarks again when you need to find it? Maybe, but I find that storing the programming articles that I read in my journal means that it's easier to find them again.

3. Problems

Sometimes the best way to think through problems is to write about them. I've faced a number of difficult problems in code in my experience. Each time I've faced such a problem I write about it. I ask myself a few questions about the code and what needs to be done in order to maintain the code or write a new feature for it. Writing through such problems can often expose a chain of thought that might not have been immediately clear when you first faced the problem.

Such writing like this goes in the journal along with a summary indicating whether writing through the problem was successful or not.

4. Reviews

How many of you as programmers review your day? Did you record that big win you did today in refactoring that monster class into six separate service classes that are now fully tested and don't break the single responsibility principle?

If not why not?

I'm not the most confident of people so when I'm staring at some code that's holding me back, I find it useful to review my previous wins just to tell myself that yes I can overcome this problem. Sometimes just a review of what we did in the past is enough to get us in the right frame of mind to overcoming programming problems.

Do it daily

Perhaps the most important thing to remember about keeping a journal is to make sure that you fill it in daily. Don't worry about holidays or weekends where you're not working or programming. Missing days is fine.

I find that the easiest way to remember is that if I wrote any code that day, I record a journal entry on it. It doesn't need to be an epic monologue to describe the two line change you made to an open source project. Keep your journal entry relative in size to the amount of code you wrote that day.

In the past I would have articles bookmarked in one place, notes on code saved in a commit and snippets stored in a snippet manager. That's a lot of information spread out. Having it in one place makes it easy for me to review past experiences, search for snippets of code and find articles I have read. At the end of the week, I can pick out anything that requires a follow up.

It's working well for me as a learning and review aide and thanks to my Granpa for the idea!