Am I learning coding the wrong way?

Every teaching I have encountered ,videos/professors, they tend to show it in a "analytical way" like in math. But for me, I think more imagination/creativity is also crucial part in programming, 60-70% understanding/creativity and 40-30% repetitive analytical learning. I don't understand how these instructors "see" their code functions, aside from years of experience, I just don't. Some instructors just don't like "creativity," it is all stem, stem, stem to them. Am I doing this wrong?