Comment by Martin_Silenus
Comment by Martin_Silenus 18 hours ago
Sleep. Best side task for your brain.
How many times has this happened to me?
You struggle with a feature or a bug, you think about it, you weigh the pros and cons for hours... because you don't want to start something that will set you back. You're tired, but you don't want to go to sleep until you've at least made a decision for tomorrow.
Go to sleep. Now.
Then you wake up knowing immediately what to do. You hardly believe it, because it was so hard to find before you sleep. And you do it. And it works. And you know that sleep was the key.
I've shared this before, but it seems relevant here:
Several years ago a Facebook recruiter invited me to interview with them. It mostly went well, except I bombed the leetcode algorithm quiz.
The next day, as I expected, they sent me a polite note thanking me for interviewing but they would be moving on with other candidates.
The morning after that, I woke up and before I opened my eyes I saw the complete solution on the back of my eyelids, about 20 lines of code.
I stepped through the code mentally and thought, "Yes! This will work!"
So I ran to my computer and typed the code in to test it. Other than one bug - this was old-school JavaScript and I'd forgotten one var statement, so there was an inadvertent global - it worked perfectly.