15
Shoutout to the guy who told me to just copy-paste code from Stack Overflow
My buddy Mark kept saying I should just grab code snippets from Stack Overflow instead of writing everything from scratch. I ignored him for 2 months, struggling through a Python script for work. Finally tried it last week and got my whole inventory tracker working in 3 hours instead of 3 days. Has anyone else felt guilty about copy-pasting code at first, then realized it's totally fine?
3 comments
Log in to join the discussion
Log In3 Comments
mitchell.avery4d ago
Wait, is copying code actually helping you learn though? I get it saves time in the moment but you're skipping the whole point of coding. The real skill is figuring out why something works, not just making it run. Stack Overflow code is fine for quick fixes but if you copy paste whole scripts you'll never get good at debugging or building your own solutions. My first boss told me to type everything out by hand for the first year. Made me a way stronger developer.
0
fionamurphy4d ago
Your first boss sounds like a saint (or a sadist, honestly depends on the day). @mitchell.avery I hear you loud and clear, but my lazy brain just can't resist a good Ctrl+C when I'm stuck on a loop. There's a middle ground though - I'll copy a snippet, then spend way too long trying to figure out why it breaks when I plug it into my janky code. Like last week, I grabbed a function for parsing dates and it took me an hour to realize the original used Python 3.10 features I didn't have. Copying the script itself is a waste, but stealing the logic with your own hands? That's where the magic happens.
5
gray3144d ago
Respectfully, I gotta disagree a bit. Typing stuff out by hand for a year sounds excessive, like yeah it builds muscle memory but you can also spend that time learning actual design patterns. @fionamurphy made a good point about stealing the logic and making it your own, because that forces you to understand the why behind the code. Copying a whole function line for line without changing anything is different from studying a snippet, rewriting it in your own style, and breaking it in the process. That's where the real learning happens, not in mindless transcription.
6