To add to that, leaving something in a very obviously broken unfinished state really helps to jump back into the flow the next morning, or whenever you come back.
I actually find it very hard to do this, to walk away with some code that isn't compiling or a test that isn't passing. It feels like leaving something unfinished.
When you return it's an easy jumping off point, with a tangible goal and helps bring you back into the context.
That's a great trick. I often leave myself a TODO in a source code. But as a plain text, not as a syntactically valid comment. With this project won't compile and on the next day is obvious where I ended up.
I'll just delete what I wrote and forget about. It also doesn't work with python. Can someone make a todo app that forces you to see it? I feel like it's already done.
I actually hate leaving something not compiling in the evening, it feels like things are unfinished, but it helps getting back into it. I tend to use this more when taking a break for an hour or two.
But it is effective.
However leaving an intentionally broken comment sounds like a good way to get the sense of completion for the day, but have the compiler focus your attention on where you left off!
I actually find it very hard to do this, to walk away with some code that isn't compiling or a test that isn't passing. It feels like leaving something unfinished.
When you return it's an easy jumping off point, with a tangible goal and helps bring you back into the context.