I spent years programming as an amateur/hobbyist and I thought I knew it all. When I started studying discrete maths and functional programming at the university level it opened my eyes to a lot of things. Suddenly computers weren't hardware they were just implementations of a theoretical idea where many more things were actually possible than I had ever thought of before.
Once you know even elementary discrete math such as sets and logic programming becomes more of an exercise in seeing if you can realize abstract ideas and models.
I do wish CS gave me a better more practical mindset around real world problem solving though. Maybe there are some things you can only learn in the industry but it took me awhile to adjust my attitude and really become a productive programmer.