You could use a physical notebook, but unless you expect to want documentation of what you were working on for some legal reason, I don't see the point. And most programmers I know hate writing things out by hand.

There's no need to use anything fancier. And if you're writing code all day, you can just keep your log file open in your editor of choice, so that you don't need to leave your hacking environment to make a note of something. I'm an emacs junkie and use org-mode to keep all my notes, but use whatever you're comfortable with.

Keeping this nice text file, regularly backed up, is useless if you don't record relevant things into it. Getting yourself into the habit of writing enough down is tricky. One strategy I've found helpful is to write down a list of "triggers" for situations that you promise to always record. With an explict list of these that you've decided to always record, you can get good at making a note whenever you perform one of these tasks, which gets you into the habit of writing things down. Here's a partial list of some of the sorts of things I make a point of writing down:

Whenever I take a measurement. That is, any time I run time , or look at top to figure out how much memory a program under development is using, or similar, I'll write down the number and the circumstances under which it was recorded. I've found that I almost always would like to have a better record of such things later.

, or look at to figure out how much memory a program under development is using, or similar, I'll write down the number and the circumstances under which it was recorded. I've found that I almost always would like to have a better record of such things later. Whenever I do a non-trivial search and find a result. This can be anything from googling for a solution to some problem where it takes me several tries to find the right keywords, or grepping a large codebase searching for the function that performs some task, or tracking down some API function in documentation. If I wanted it once, I'll often want it later, and if it was hard to find, I'll feel stupid if I didn't write it down.

Whenever I make an explicit design decision. If I'm thinking about how to design some function, system, process, or whatever, I'll stop and take a moment to write down the options I was considering, and why I made the choice I did. This ensures I can go back and remember why I built a system the way it is.

Whenever I wish I had written something down last time. This should be obvious, but if you find yourself thinking "I know I did this before; Why didn't I take notes?", you should always make a point of writing it down this time, no matter what excuse you come up with for why you really won't need that information a third time.

These categories are deliberately broad, but at the same time well-defined. It's fairly easy to train yourself to notice whenever any of these points triggers, and remember to stop and write something down. And that's the first step to getting in the habit of writing down everything that you'll later wish you had written down.