I agree with this 100%. The proof exercises you have to complete in discrete math make for great programming exercises. They force you to ask yourself
1. What's the problem? 2. What do we know? 3. How do we get to the end? 4. What does it look like to be "done"?
These are great questions to ask yourself when programming.