This is how I often program as well. I’ve realized that when you do this it’s crucial to have lots of tests to validate the program’s behavior, because it can easily look right and mostly run right without actually being correct.
Though this only works for the implementation side of things in my experience; you still need a good mental model of roughly what you’re aiming for architecturally, I think.