I'm talking about that feeling of hoping that something will happen, despite that thing possibly causing a negative effect—in spite of that negative effect, even.
Context: I'm a software developer. When I write code, part of me wants to look back at it a year later and cringe at how terrible it is, as it's a mark of progress. The general wisdom in the field is that if you look back at old code and you're still extremely pleased with it, odds are you're not progressing as much as you could or should be. The cringe you feel is not a great feeling, but ultimately your higher faculties know it's a good thing.