Programming: Math or Writing?

Is programming like math, or is it like writing? I think there are elements of both in it, even though programming is a discipline of its own. Nevertheless, it is interesting to think about what aspects are like math, and what aspects are like writing. Maybe it will even lead to a better understanding of what programming is.

Like Math

Sometimes, the domain of the program requires math — for example; machine learning, graphics programming, or financial modelling. But I am more interested here in parallels with math that apply regardless of the domain.