I&#x27;ll tell you an open secret:  Focusing very intently on difficult maths for an extended period of time can make almost anyone begin to experience aspects of mental illness.<p>The physics community has dealt with this, DOD code breakers deal with it, the manhattan project, etc.  It&#x27;s a  well studied phenomena because of how it related to the war effort and much of the research documentation is declassified, in the public domain, and is a matter of the historical record.<p>My point is software development is just another domain where this research applies.  This information is generally recognized by the pop culture as evidenced by the fact that there are several blockbuster movies about it, for example the film &#x27;Pi&#x27; by Darren Aronofsky and &#x27;A beautiful mind&#x27;. However this phenomena is generally not accepted by the startup community.  I assume that the reason for this is because recognizing it could theoretically lead to a rise in insurance cases by engineers who developed serious mental illness over time due to prolonged exposure to what were known to be unsafe working conditions.  In my opinion it should be thought of as a high risk job akin to scuba instructor, or roofer.<p>So the whole thing is swept under the rug.  Never the less I will give my recommendations as a developer who works all the time and has wrestled with this phenomena in the past:<p>- Force yourself to hike&#x2F;walk&#x2F;bike outdoors for at least an hour per day.  I&#x27;m convinced that merely jogging on a tread mill or gym excercise does not have the same benefit.  Think of the outdoors (and the sun) as a relief valve for the &quot;cabin fever&quot; effect.<p>- A daily Zazen practice (15 minutes+) This is the kind of meditation from Japanese buddhism where you&#x27;re not trying to accomplish or &quot;do&quot; anything, you just sit, in a good posture.  I think of this as putting your overclocked CPU in hibernate mode long enough for the heat sync to do it&#x27;s thing.  I think this can provide a similar effect to having had a couple extra good hours of sleep, and all it costs is a few minutes of your day.  The more you practice it, the better it works.<p>- healthy diet and exercise<p>- yoga (or just plain stretching)<p>- Do not under-estimate prolonged caffeine consumption as a likely co-factor for many symptoms.  Always eliminate this as a possibility whenever you can<p>- As a relaxation excercise take a break during your day and spend a few minutes in a quiet place directing your attention to any area of your back, neck, shoulders, or even your face whereever you expereince a sensation of pressure or weight.  Sometimes just stopping to pay attention that these muscle groups are becoming tense is enough to help them relax some.<p>- super mellow music at a low volume even if it&#x27;s not what you prefer generally can help when writing software.  Classical music, downtempo, ambient, chill-out, atomospheric drum and bass, even unusual stuff like gregorian chant.  It can be slow and boring, after all it&#x27;s less about entertainment and more about the cumulative effect it has on your brain when used as background music.<p>example of downtempo genre: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=tYdebVcZDPw" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=tYdebVcZDPw</a><p>soma.fm&#x2F;groovesalad plays a good mix imho.  There&#x27;s good studies on this on mice.  A good rule of thumb is asking yourself this question &quot;could this song be characterized as &#x27;intense&#x27; in any way ?&quot; if so then save it for some other activity