Patricia Highsmith said this quote

Fantasy, an unflagging optimism is necessary for a writer at all stages of this rough game. A kind of madness is therefore necessary, when there is every logical reason for a state of depression and discouragement. Perhaps the fact that I can react with utter gloom to this is what keeps me from being psychotic and keeps me merely neurotic. I am doing quite a good day's work today. But I am also aware of the madness that actually sustains me, and I am not made more comfortable or happy by it.