

Ask HN: Sunday brunch question: Do you dream in code? - pacaro

New problems, changing languages, revisiting old code, all of these seem to make me dream in code. I&#x27;m curious how prevalent this is.
======
gee_totes
I've dreamt in code a few times, but here is my favorite story.

After a long 14 day I drifted off to sleep on the subway. I had a dream in SQL
about trying to figure out the best way to set up the moment with a girl I
liked so I could go in for a kiss. For some reason, it involved alot of table
joins and sub-queries. When I woke up, I realized I had the solution to the
de-duplication problem I had been working on all day!

------
gemmakbarlow
Not regularly, but I've found bugs twice whilst dreaming ... and it's amazing
when it happens!

Dream consists of looking through code... then suddenly notice something in my
dream-code that isn't quite right and fix it. If I wake up I know it was a
dream but am left wondering if it's a bug in real life...

Twice it has been. Brains are weird.

------
cafard
Occasionally, yes. The oddest computer-related dream probably occurred when I
was taking a computability course: cars entering and leaving parking spaces in
a dream that had to do with the "pumping lemma" for regular languages.

------
adenner
Very rarely, however I do know a developer who dreamed a full day's work where
he solved a big problem and was then really confused when all of his hard work
didn't exist the next morning.

~~~
sonabinu
did it help him arrive at a solution? i've seen a few people who have that
experience - the fact that they could have a solution in a dream helped them
solve the problem

~~~
lutusp
This is a human behavior with a long, very interesting history. Chemist August
Kekule supposedly was trying to sort out the chemical structure of Benzene,
dozed off, and dreamt of a snake with his tail in his mouth:

[http://en.wikipedia.org/wiki/August_Kekul%C3%A9#The_ouroboro...](http://en.wikipedia.org/wiki/August_Kekul%C3%A9#The_ouroboros_dream)

There are many other similar stories of various kinds of technical problems
being solved during sleep and/or while dreaming.

------
berliner70
On an abstract level quite often where I have to process things in a certain
order and similar problems. It seems to me that this happens when I'm rather
overworked

------
mrgreen
Happen quite often especially when I study something new, I wake up with the
voice in my brain that repeats commands like "dot controller" and stuff like
that..

------
rw
I used to dream in code, but now I dream in graphs that represent data
structures. This happened when I began focusing on memory layout over syntax
and API signatures.

------
krrishd
I don't dream in code, but sometimes I think in code. I find myself converting
non-tech issues into syntax, and analyzing it for potential 'bug fixes' until
I snap out of it and realize how weird that is.

------
sonabinu
interesting ... was discussing this with another programmer.

------
hauget
I dream in different languages sometimes. It's scary.

------
_RPM
I think in code. I have dreamed about code.

