I've known a lot of math people, and /on average/ I think they're more capable of programming useful code than the other college graduate groups I've spent a lot of time working with (psychology, economics, physics) /on average/.
That said, the best mathematicians I've known were mostly rubbish at real programming, and the best programmers I've known have come out of computer engineering or computer science.
If you need a correct, but otherwise useless implementation, a mathematician is a pretty good bet. If you need performance, readability, documentation, I'd look elsewhere most of the time.