I've never been able to write (code or prose) while listening to music. I get too distracted.
OTOH, watching a TV show (or listening to music) really helps with exercising (both starting, and pushing myself).
YMM (and probably does) V.