17
Tired of seeing beginners copy-paste Stack Overflow code without understanding it
I was helping a guy in my local coding meetup last Tuesday who copied a whole function from Stack Overflow to fix his login form, but when I asked him what each line did he just stared at me. He spent 3 hours debugging later because he didn't realize the code was for a different framework entirely. How do you guys force yourself to actually read and understand code before using it?
2 comments
Log in to join the discussion
Log In2 Comments
river1831d ago
Three weeks ago I watched a guy copy a React hook example for his login system and it took him four days to figure out why nothing rendered on the page. Turns out he missed the single line that imported the hook from the right library. Honestly sometimes copying code without reading is faster than actually learning the framework from scratch. Most of us aren't building anything that needs to be perfectly optimized anyway. If the code works and you're just making a personal project or a prototype, who cares if you don't know every line by heart? You can always come back and understand it later when something breaks.
1
cooper.spencer1d ago
oh man i feel this so hard. river183 brings up a good point about personal projects but i think there's a middle ground somewhere. like yeah you can just copy paste for a prototype but if you're gonna spend 3 hours debugging anyway you might as well spend 30 mins reading through the code first. i've been there too where i copied something without looking and then spent way longer fixing it than if i just tried to understand it from the start.
1