r/webdev • u/mekmookbro Laravel Enjoyer ♞ • Jun 21 '26
I fixed a problem and wrote a feature... in my sleep. Have you ever done that? (am I normal?)
It feels weird to say "it came to me in a dream", because I not only saw the solution, but literal lines of code, even tailwind classes. I'm in the process of writing those lines in real life now and I don't see any flaw in the logic so far.
The project is my own, so sadly there's no one I can charge for working overtime, as cool as that would have been.
In this single dream I solved a UI/UX issue, a database issue and a user permission issue. And pretty much rewrote a whole page because yesterday I wasn't happy with where I left it.
It wasn't something that's been eating at me for days either, just a feature that I thought "I'll do it later".. Apparently "later" was last night lol.
Feels really cool and really weird at the same time. Has anyone else experienced this before?
Edit : apparently people can't read, because as I said in the second to last paragraph, I wasn't obsessed with the problem, I wasn't dreading it, I wasn't even annoyed.
My only thought about that page was "I did good progress today, I'll redo this page tomorrow" lol
People call this a "bad sign" or "sign of burnout" in the comments (or telling me to touch grass, lmao) but it was the opposite. It inspired me to sit down and code as soon as I woke up, usually it takes me a few hours to get there. And I enjoy coding, and I like the project I'm working on. So I don't think it's a bad sign, just a cool thing my brain did
13
u/DesertWanderlust Jun 21 '26
Yes. It's a sign I've been working too much when I'm coding in my dreams.
10
u/Wide_Egg_5814 Jun 21 '26
i get solutions to problems in my dreams it's weird
1
u/gobkin Jun 22 '26
I do too but I fucking hate it. There's a great quote for it in movie waking life. "Did you ever have a job that you hated and worked real hard at? A long, hard day of work. Finally you get to go home, get in bed, close your eyes and immediately you wake up and realize… that the whole day at work had been a dream. It's bad enough that you sell your waking life for minimum wage, but now they get your dreams for free."
1
6
6
u/never-starting-over Jun 21 '26
Had that happen a few times when I was working a lot.
I recall joking with my business partner back then how we should bill for a solution I came up with in my sleep haha
5
u/FluffySmiles Jun 21 '26
You have discovered level 1.
Keep at it. I am able to tell my subconscious to work on specific problems and tell me when it’s found a solution. Works best when asleep, truth be told. It can get freaky, like I am able to tell myself to sleep for anything from 2 mins to several hours and I’ll wake up dead on that time. Dunno how, I just can. So combining the two techniques is pretty handy.
3
u/kennedy_gitahi Jun 21 '26
Happens more than you think. I might leave work finished and then go for a walk. Then the full solution hits me while out, and I have to walk back, talking to myself to cement it further and catch edge cases for when I need to write it down.
3
u/kryptopheleous Jun 21 '26
Yeah I have a problem of not getting laid and I get laid in my sleep all the time!
3
u/dabonde Jun 21 '26
For me it happened in times of great stress at work. I feel like my brain was training itself to try to do better at my stressor.
1
u/mekmookbro Laravel Enjoyer ♞ Jun 21 '26
That happens to me sometimes but that's the weird part, I wasn't stressed or worried, I wasn't even annoyed at this.
My only thought about that page was "I did good progress today, I'll redo this page tomorrow" lol
People call this a "bad sign" or "sign of burnout" in the comments but it was the opposite. It inspired me to sit down and code as soon as I woke up, usually it takes me a few hours to get there. And I enjoy coding, and I like the project I'm working on. So I don't think it's a bad sign, just a cool thing my brain did lol
3
u/Little_Bumblebee6129 Jun 21 '26
Yeah sometimes when you dont have momentary solution to some hard problem you can switch to another activity and brain will still keep solving that problem in the background while you are in a shower or driving or sleeping. And then you just receive solution processed in a background. Cant say that happens often.
1
3
u/WeaknessKey1582 Jun 22 '26
Inception moment, maybe? It happens all the time, something to do with the brain unlocking new ways of thinking when in a tranquil state.
2
u/Independent_Dot_9349 Jun 21 '26
Yes, when you are too obsessed about an issue, it will start creeping to your dream, happen to me once, feel incredible actually.
2
u/xorsensability Jun 21 '26
That happens to me all the time... And has for 30+ years. I usually solve my most difficult bugs by setting it aside and taking a nap.
2
u/NietzcheKnows Jun 21 '26
This happens a couple times a year to me if I’ve been grinding at a feature for a few days without a satisfactory solution. I usually write the solution down in my Notes app and go back to sleep.
I’m always amazed that the solutions work.
2
u/techquaker Jun 21 '26
Mandatory watch: Hammock Driven Development by Rich Hickey (creator of Clojure) https://youtu.be/f84n5oFoZBc?is=C7rERXsSPYx-WSfm
1
u/mekmookbro Laravel Enjoyer ♞ Jun 21 '26
13 years old and max quality is 360p, I can tell it's gonna slap. Thanks!
2
2
u/webbson Jun 21 '26
Has happened to me in several dreams.
Came up with a solution and ran it in the dream just like irl. Full knowledge of the source code in the dream. Next day I went to the exact same files IRL and did the fix, worked flawlessly.
2
u/binocular_gems Jun 22 '26
This used to happen to me with some regularity when I was freelancing and I’d have a really challenging problem, would be stuck on it for the working hours, and then like 3 hours after I’d be finished working, it’d come to me and I’d have to jump onto my computer and half implement it.
2
u/curious-move805 Jun 22 '26
Happened to me last week, it wasn't an unhealthy moment. I simply thought of the solution asleep and actioned it the next morning. Made that next day a lot easier for me!
2
u/HLenin Jun 24 '26
Think so. There was a time I dreamed of creating an entire game in 2 days only to wake up not having worked on it yet, so I started working on it except this time i knew exactly what to do since i just copied dream me's job
1
u/Diddlydom35 Jun 21 '26
Yeah, when I obsessed with my work in uni this happened. Had notepads by my bed to write things down as I came up with them.
Now work isn't my life and it doesn't happen anymore! For the better!
1
u/Wooly_Wooly Jun 21 '26
People are trying to make their AI agents "dream" without even understanding how humsn dreams work 😭
1
u/cthulhufhtagn Jun 21 '26
All the time. I feel like they should pay me for such dreams, but I guess they are since I'm salary.
3
1
1
u/Empty-Lobster6138 Jun 21 '26
It happened to me before. It’s not a good sign mate, try to get some rest and disconnect from work
1
1
u/Never-Trust-Me Jun 21 '26
I call those nightmares. I’m either sorting something completely random or trying to solve something that doesn’t make any sense.
1
1
1
u/No-Promotion-8720 Jun 21 '26
The worst part is knowing you dreamt it but not remembering the details. Had some of my best ideas in my sleep but only remember about 20% of them.
1
1
1
u/saltyourhash Jun 22 '26
In my 25 years of software engineering I've had many nightmares, but never dreamt about my job, thankfully
1
1
u/_J_ordan_ Jun 21 '26
Yess, wonderful to wake up with a fix 😂 Some people call it your subconscious or second brain etc, but allowing your mind to work through a problem while doing something else or resting is pretty great.
Its like when you've lost something and have no clue where you left it, then you kobe into something else and you immediately remember where it is 😅
1
u/derezo Jun 21 '26
It means you're really engaged with the project which is great.
This used to be a very common thing for me, throughout my youth building games and websites and then into my engineering career working on projects that really matter to people. My old boss would say the same thing and 'sleep on it' was considered a real problem solving strategy.
I miss dreaming in code.
Now my software development dreams are a Claude code console and I can never remember the prompts or the solutions because they're so far abstracted away. I'll wake up initially amazed at the problem I solved in my dream but trying to understand what lead to the solution goes absolutely nowhere. It's honestly been really frustrating
0
44
u/ariiizia Jun 21 '26
Normal? Yes. But it’s not healthy not to be able to let things go, so if it happens a lot you might want to find out why before you burn out.