D
19

PSA: That "just copy from Stack Overflow" advice nearly broke my app 3 times

I overheard a senior dev at a coffee shop last Thursday say that beginners should "copy code like a chef copies a recipe, not like a kid tracing a drawing." That really hit me because I spent 3 hours debugging a function I'd pasted from a 2017 forum post. Turns out the snippet used an outdated library version that didn't work with my current setup (Python 3.11 vs the old 3.6 syntax). I finally learned to read each line before dropping it in, and I check the date on posts now. Has anyone else wasted a whole evening on a bad copy-paste job?
2 comments

Log in to join the discussion

Log In
2 Comments
thomas105
thomas1051mo ago
You used to hear people say that and think they were just being dramatic, but man, that chef analogy finally clicked something in my head. I remember pulling a chunk of code off a five year old blog post for handling file uploads and wondering why everything broke when the file names had spaces. Never even thought to look at the date on the post or check what version of Python they were running. Three hours later I found out the whole snippet relied on a module that got deprecated two versions ago. Now I read every single line before I paste anything and I still miss stuff sometimes.
2
abbyc33
abbyc331mo ago
Ugh yeah I've been there. That chef vs kid tracing thing is actually a really good way to put it though, wish I'd heard that years ago.
1