Software is more akin to poetry, it’s terse and has highly structured forms that it needs to adhere to.
It is however primarily a form of writing and secondarily a kind of math.
"Software is prose. It is written to communicate ideas to others, it has the interesting side effect that it can be transformed into something a computer can execute." -Chet Hendrickson
Refactoring & debugging are copy editing.