24
My brother told me to just copy and paste code from Stack Overflow
My older brother who works in IT gave me this advice when I started learning Python 3 months ago. He said don't bother writing everything from scratch, just grab what you need and tweak it. So I copied a whole block of code for a calculator project without understanding a single line. It worked fine for two weeks until I tried to add a simple subtraction feature and the whole thing crashed. Turned out the original code had a hidden bug that only showed up when you used negative numbers. I spent 6 hours on a Tuesday night trying to fix it before I gave up and rewrote everything from scratch. My brother laughed when I told him and said well at least you learned something. Has anyone else had a similar experience where copying code caused more problems than it solved?
2 comments
Log in to join the discussion
Log In2 Comments
wadebailey1mo ago
My buddy Dave did this exact thing with a Discord bot. Found some code for a music player, didn't read a line of it. Worked great for like a month. Then he tried to add a "skip to next song" button and the whole thing started posting random lyrics in the general chat at 3am. Took him forever to trace it back to some weird regex pattern in the original code that triggered on keywords. He just deleted the whole project and started over with a tutorial.
6
blair_green1mo ago
My cousin copied a SQL query that accidentally deleted his whole music library, so @wadebailey, at least your friend only got random lyrics.
3