Occasionally, I’d fall asleep while still thinking about code. I’m sure it happens to anyone who’s deeply concentrated on their work while going to sleep, but this one surprised me.
For me, this code-sleep combination happens very rarely. Simply because I rarely keep thinking about code in the evening hours - house tasks and simple, mindless rest, occupy most of my late hours.
Anyway, on this specific occasion, I was actively imagining a few lines of code in Tortuga and how I would go about continuing it. Now, I don’t actually remember what I dreamt about, and I’m pretty certain it wasn’t only code, but an amazing thing happened when I woke up.
When I woke up, I recalled the last few seconds of my “dream” (if you could even call it that) - it was going over the logic of possible “forks” of code in order to see which would be better. I didn’t even realize that I ever did that! I figured out what code not to write in my sleep! Ok it sounds less amazing than it was a few minutes ago, but bare with me.
This leads me to believe that my sleeping mind was attempting to slowly and methodically write a block, a few lines, of pseudocode, and simulate running them to have a look at the results. It’s like leaving the mind autopilot on a task to check on the results in the morning.
This seems like a brute forcing approach, hence “brute force coding” is the name I came up with.
Neat ain’t it? Has this been happening to anyone?