May I suggest a purely rational, evidence based take? The trap is your belief in a linear relationship between effort and outcome. Working harder and longer produces more productivity, right? That's false. As you say so yourself, your memory goes to shit. It's not just a law of diminishing returns. For coders, past a certain point, exhaustion leads you to start undoing your work. You are into negative productivity. I…
- Am I tempted to erase types? - Am I tempted to disable unit tests? - Am I tempted to go for technical debt?
Then yes, I have to take a long walk, read a book, or do some manual work until I feel refreshed and wide perspective returns.