In my experience, both.
Being able to keep focused and finish one thing is very variable when sitting down to code. In the planning or idea phase I do like to follow and take note of interesting tangents of thought that might be related to the project.