Yup! To learn music, cooking, martial arts, etc., you start by following someone else to build the muscle memory on doing the skill. As a follow-up, my own research [1] on retyping code showed students earned higher grades and submitted less erroneous code. Replicating technical skills is a common practice technique that seems to have been "lost" in current CS education.
[1] https://dl.acm.org/doi/pdf/10.1145/3373165.3373177