The most important thing I learnt: you're not your code. Whatever you're writing today will be changed tomorrow, or even thrown away in a week. Some PM will realize that they don't want it, or they want something different, and that's OK. You're writing code to solve a problem, not to write code.