You should learn to program in a well structured language first: Ocaml is recommended, Haskell is also good but a bit harder to get a working compiler and harder to learn because it is purely functional.
Mathematics is of little use in programming (the math that is useful is too hard, namely category theory). However some basic type theory is useful.
You can't learn good programming in languages like C, the important stuff is too deeply buried in housekeeping tasks and historical stupidities.