Łukasz Wróbel

Writing

I fixed a bug in my sleep. That never happened again, but now I notice when I'm stuck.

Years ago, when I was still in college, I was struggling with a program I was working on. It was meant to transfer files over a network. It worked fine for small files, but anything bigger would get cut off at 64 megabytes tops. I stayed up late trying to debug it. Eventually, I gave in and fell asleep.

In my dream, I started to “think” about the problem. Sixty-four megabytes is about 65,000 kilobytes. And 65,000 is just about the maximum number of network ports. Data was transferred in 1-kilobyte chunks. Then I realized: each chunk must be opening a new connection that I don’t close. I’m using up all the ports!

I woke up in the morning, jumped straight to the computer, and fixed the program. That was it! Maybe it shouldn’t have come as a surprise. After all, Kekulé’s benzene ring and Mendeleev’s periodic table were both supposedly invented in a dream.

I wish problem solving in my dreams had become my superpower, but it didn’t. I have some minor “aha” moments in my dreams from time to time, but nothing extraordinary. No more logical conclusions in my sleep for me.

However, there’s something else I’ve learned instead. I’ve started to notice when I’m stuck.

If I’m about to make a decision, I check whether I’m in good enough shape to make it. I try to notice concerning patterns. Maybe I’m going in circles or struggling to concentrate, or certain actions (like understanding the context) take noticeably longer than usual. It’s a sign for me to let go.

If I push myself too hard, one of three things happens:

  1. I get nothing done.
  2. I end up with a mediocre solution.
  3. I come up with a good solution, but it takes several times the effort it should.

What do I do instead of trying to force it? I switch to a different task, or to no task at all. The best out-of-the-box ideas come to me unexpectedly, e.g., when I take a shower or daydream. But I don’t jump to a tempting conclusion like this one: “All it takes to become a 10x CEO is taking a shower five times a day!” No, I can’t rush it. Sometimes I need to take a break or get a good night’s sleep. My mind needs good working conditions, and those I can’t force.

Of course, I don’t always have the luxury of postponing a decision. There are situations where an imperfect decision is still better than a delayed one or no decision at all. Most of my everyday decisions can be reversed or fixed, so when it’s urgent, it may be better for me to take action and improve later if needed.

That night in college, I had to give in and get some sleep. These days I’m more open to saying “enough” voluntarily.

A man asleep in bed in striped pajamas, smiling. A thought bubble rises from his head: 64 MB ≈ 65,000 × 1 KB. 1 chunk = 1 new connection. never closed! Below: I fixed a bug in my sleep. That never happened again, but now I notice when I'm stuck.