I used to copy my friend's code line by line, then I tried typing it from memory and everything broke | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
I used to copy my friend's code line by line, then I tried typing it from memory and everything broke
When I started learning Python about 8 months ago I would watch a tutorial and copy every line into my editor exactly as the guy typed it. It worked every time, the little guessing game ran fine, and I felt like I was actually getting it. Then one night my laptop wifi died in the middle of a video and I decided to just write the same program from memory instead of rewinding. It was a mess. I forgot a colon after my if statement, mixed up where the indent went, and called a function before I even defined it. Spent about 40 minutes staring at a red error line that just said invalid syntax with no other clues. It was annoying but honestly the most I have learned in one sitting, because fixing my own broken code taught me way more than typing someone else's perfect code ever did. Now I try to build the thing first, break it, then go back and watch how the tutorial guy did it. Does anyone else learn better by failing first, or am I just making it harder on myself?
Copying code exactly is actually a skill too, and people act like it's cheating when it's not. You learn syntax, spacing, and structure by doing it over and over, same way you learn to write by copying sentences in school before you write your own. Your fail-first method wastes a ton of time on dumb stuff like a missing colon when you could be learning loops and functions instead. Plus you can build bad habits that stick because nobody corrected you, and now you're debugging your own weird style instead of learning the right way. There's a reason teachers have you follow examples first before letting you freestyle. Go slow, copy a lot, then branch out when the basics are automatic.