Recently I’ve been working on some side projects late into the night. If I don’t have any commitments on a weekend I may stay up late working on something and then sleep in the next day. Because I can, and it’s awesome.
But I also have to learn when it’s time to stop and go the f**k to sleep.
A few nights ago I was working on one of these projects and got stuck on one thing that wasn’t working even though I KNEW it should have been. After struggling and trying to debug for 45 minutes, I gave up, commented my battle in the code and went to bed.
Tonight I came back to that code and fixed my problem in less than a minute. It made so much sense that I had a function call inside a loop when it shouldn’t have been. With a clear head I caught the mistake almost instantaneously, but a few nights before I toiled away forever to no avail, cursing computers the whole time.
The same thing just happened to me tonight: some parameter in a POST request isn’t working and it’s not working even though it SHOULD BE. So for now I’ll just go to sleep, dream of successful Ajax calls and come back to it when the sun is up.Send a pull request for this post on GitHub.