I always felt like maths was too abstract to keep me engaged, but when the output of your work is immediately observable visually it becomes a lot more engaging. There's just something so much more satisfying being able to "see" the results.
Plus as a self-taught programmer, I find it much easier to learn front-to-back by deciding on a desired outcome and working towards it, rather than progressively building up abstract fundamental skills that can later be combined to achieve a desired outcome (which is essentially the traditional academia path for learning STEM fields)