Should you listen to a layperson or a doctor?

A layman thinks that when suffering from chronic pain, you should rest your body completely, not do any sports, or at least only exercise lightly. The doctor says exercise is definitely beneficial, especially for chronic pain, as long as I don't overdo it. And I always stretch regularly. Because muscle loss doesn’t reduce the pain….