I’m not sure if any of my developer friends have experienced this but I have experienced this personally. I don’t usually get sleep easily if I don’t come up with a solution for what I’m coding. I will usually get disturbed during the sleep and I get up again and complete the code and then only I will sleep. If not fully, I will at least think through the solution completely in my mind and draft it and then only sleep. If I don’t do that, my mind keeps thinking about solutions and tries to solve problems in the sleep itself. I have even had dreams related to this multiple times.
I would be traveling somewhere in the dream of trying to solve the problem that I have with my requirements. One of the pain points that I always have is that I don’t really get satisfied with my code at all. I always keep thinking if I can optimize this even further or not. Bringing a solution gives satisfaction but optimizing takes away a little bit of satisfaction from me. At times, even if I complete coding and try to sleep, my mind will still continue to work on optimizing the code that I wrote. I have tried multiple times but I couldn’t get rid of this. I have to find a way to convince my brain that whatever I write is optimized and I should think about optimization only when I allocate some time for it.
Life of a developer
The life of a developer is not normal compared to other people. I have shared thoughts with my fellow developer buddies as well. They have also mentioned the same. When it comes to reading and learning new code or technologies, we tend to forget sleep and food and almost everything. Especially when we are locked in a room and if the only thing that we can see in front of us is the Visual Studio Code, we can almost forget anything and stay without food and water for hours together. My mind will not even ask me for a pee. Later after a few hours, I will have a feeling that I have been holding my pee for several hours.
Sometimes I even hate socializing. When I have some code to be done and when I keep coding or learning something interestingly, it will be so unfortunate that I will have some guests in the house. My thought process will be stopped abruptly. I always prefer staying in a room thinking about how I should be finding the solution for the requirement. Sometimes it can be highly challenging and sometimes it can be very interesting and sometimes it can be irritating. I have been through all those phases.
Not only for coders
I don’t think this is the case for only developers. I believe for anyone who is seriously working on something will have this problem. For instance, I have heard my mother saying this. She has stitching clothes as one of her hobbies. I have seen her saying that she cannot sleep if she keeps the work pending or fail to complete the stitching work before sleep. I have seen her staying awake and working late at night to complete that. People who do craftworks and paintings will also have this curiosity. I remember even my school friends tell about this during school days when there is so much to study.
I believe there is nothing harm in this and it happens for anyone who works with their creativity. Any creative activity that can create this situation is what I observed. We have to be happy about it but one thing to keep in mind is that we shouldn’t get stressed out because of this. We have to learn to let things go. The good thing is that this creative feeling gives a lot of motivation for us to do things better in our life.